CSSを使用したテキストの色の設定
CSSのcolorプロパティは、要素のテキストの色を設定するために使用されます。
構文
CSSカラープロパティの構文は次のとおりです-
Selector {
color: /*value*/
} 例
次の例は、CSSカラープロパティ-
を示しています。<!DOCTYPE html>
<html lang="en">
<head>
<style>
div {
height: 100px;
width: 200px;
margin: 10px;
display: flex;
float: left;
font-size: 1.4em;
word-spacing: 30px;
line-height: 4.5em;
border: thin solid blue;
border-radius: 40%;
text-align: center;
color: rebeccapurple;
}
div + div{
background-color: beige;
color: red;
text-align: justify;
text-decoration: line-through;
}
</style>
</head>
<body>
<div>One Two</div>
<div>Three </div>
</body>
</html> 出力
これにより、次の出力が得られます-
例
<!DOCTYPE html>
<html lang="en">
<head>
<style>
p {
margin: 10px;
display: flex;
float: left;
border: 3px groove green;
text-align: center;
color: rebeccapurple;
}
span{
background-color: beige;
color: red;
text-decoration: underline;
}
</style>
</head>
<body>
<h2>What is Tableau?</h2>
<p>Tableau is a Business Intelligence tool for visually analyzing the data.
<span>Users can create and distribute an interactive and shareable dashboard,
which depict the trends, variations, and density of the data in the form of
graphs and charts. </span>
Tableau can connect to files, relational and Big Data sources to acquire and process data.</p>
</body>
</html> 出力
これにより、次の出力が得られます-
-
CSSでのカラープロパティの設定
CSSを使用して、要素のテキスト、境界線、背景の色を定義できます。 colorプロパティは、要素のテキストの色を指定するために使用されます。 構文 CSScolorプロパティの構文は次のとおりです- Selector { color: /*value*/ } 次の例は、CSSカラープロパティ-を示しています。 例 <!DOCTYPE html> <html> <head> <style> div { color: seashell; background-color
-
CSSを使用して要素のテキストの色を設定する
CSSのcolorプロパティは、要素のテキストの色を変更するために使用されます。値は、標準の色名、rgb()、rgba()、hsl()、hsla()、および16進値として指定できます。 構文 CSScolorプロパティの構文は次のとおりです- Selector { color: /*value*/ } 次の例は、CSSカラープロパティ-を示しています。 例 <!DOCTYPE html> <html> <head> <style> div { height: 50px; &nb