文字色の指定

 
文字色
ホーム > CSS2 Note > color > 文字色の指定

赤 Red

color:red;              /* キーワードで指定 */
color:#f00;             /* #rgb */
color:#ff0000;          /* #rrggbb */
color:rgb(255,0,0);     /* 整数値 0-255 */
color:rgb(100%,0%,0%);  /* %値 0%-100% */
<span style="color:red;">color:red;              /* キーワードで指定 */</span><br>
<span style="color:#f00;">color:#f00;             /* #rgb */</span><br>
<span style="color:#ff0000;">color:#ff0000;          /* #rrggbb */</span><br>
<span style="color:rgb(255,0,0);">color:rgb(255,0,0);     /* 整数値 0-255 */</span><br>
<span style="color:rgb(100%,0%,0%);">color:rgb(100%,0%,0%);  /* %値 0%-100% */</span>
 

緑 Green

color:lime;             /* キーワードで指定 */
color:#0f0;             /* #rgb */
color:#00ff00;          /* #rrggbb */
color:rgb(0,255,0);     /* 整数値 0-255 */
color:rgb(0%,100%,0%);  /* %値 0%-100% */
<span style="color:lime;">color:lime;             /* キーワードで指定 */</span><br>
<span style="color:#0f0;">color:#0f0;             /* #rgb */</span><br>
<span style="color:#00ff00;">color:#00ff00;          /* #rrggbb */</span><br>
<span style="color:rgb(0,255,0);">color:rgb(0,255,0);     /* 整数値 0-255 */</span><br>
<span style="color:rgb(0%,100%,0%);">color:rgb(0%,100%,0%);  /* %値 0%-100% */</span>
 

青 Blue

color:blue;             /* キーワードで指定 */
color:#00f;             /* #rgb */
color:#0000ff;          /* #rrggbb */
color:rgb(0.0,255);     /* 整数値 0-255 */
color:rgb(0%,0%,100%);  /* %値 0%-100% */
<span style="color:blue;">color:blue;             /* キーワードで指定 */</span><br>
<span style="color:#00f;">color:#00f;             /* #rgb */</span><br>
<span style="color:#0000ff;">color:#0000ff;          /* #rrggbb */</span><br>
<span style="color:rgb(0,0,255);">color:rgb(0.0,255);     /* 整数値 0-255 */</span><br>
<span style="color:rgb(0%,0%,100%);">color:rgb(0%,0%,100%);  /* %値 0%-100% */</span>
 
関連項目: color
トップページ CSS2 Note ページトップ
 2009/02/01発行 2009/02/01更新