■概要
color属性は、単語通り「色」、正確に文字の色を意味します。
color属性は上記のような値を使用でき、デフォルトはinferitで親要素の色を設定します。
■使用方法
#text1 { color: blue; }
#text2 { color: #000; }
#text3 { color: rgb(0, 0, 255); }
#text4 { color: rgba(100, 100, 100, 0.5); }
■例
<html>
<body>
<div style=”color: blue”>blue text</div>
<div style=”color: #0A0″>green text</div>
<div style=”color: rgb(255, 0, 0)”>red text</div>
<div style=”color: rgba(0, 255, 255, 0.5)”>aqua text</div>
</body>
</html>
出力結果
blue textgreen textred textaqua text
当サイトは広告を含めています。広告のクリックによる収益は全て当サイトの管理、維持、コンテンツ製作に使われます。