<font color="色">文字列</font>
要素名 | 属性名 | 説明 | 非推奨 | 必須属性 |
---|---|---|---|---|
font | フォントの色、種類、サイズ | 非推奨 | ||
face | フォントの種類 | 非推奨 | ||
color | フォントの色 | 非推奨 | ||
size | フォントのサイズ | 非推奨 | ||
class | クラス名 | |||
id | ID名 | |||
title | 補足情報 | |||
style | スタイルシート | |||
lang | 言語コード | |||
dir | 文字表記の方向 |
font要素の。color属性は<font color="色指定"></font>で囲まれた範囲の文字列の色を指定します。
色の指定には、色名又はカラーコードを指定します。
注意 : font要素は、HTML4.01では非推奨。
文字色を指定する場合は、スタイルシートを利用するようにして下さい。
Sample
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="ja">
<head>
<base href="http://www.abcd.com/efg/index.html">
<meta http-equiv="Content-Type" content="text/html; charset=shift_jis">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta name="author" content="制作者名">
<meta name="description" content="内容の紹介">
<meta name="keywords" content="キーワード1,キーワード2,キーワード3,・・・">
<link rel="start" href="start.html">
<link rel="index" href="index.html">
<title>文字列の色を指定する。</title>
</head>
<body text="black" bgcolor="#FFF8DC">
<p><font color="red">日光東照宮(にっこうとうしょうぐう)</font>は栃木県日光市にある神社。<font color="blue">江戸幕府初代将軍徳川家康</font>を神格化した東照大権現を祀る。 日本全国の東照宮の総本社的存在である。正式名称は地名等を冠称しない「東照宮」であるが、他の東照宮との区別のために、 <font color="red">「日光東照宮」</font>と呼ばれることが多い。</p> </body>
</html>
<html lang="ja">
<head>
<base href="http://www.abcd.com/efg/index.html">
<meta http-equiv="Content-Type" content="text/html; charset=shift_jis">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta name="author" content="制作者名">
<meta name="description" content="内容の紹介">
<meta name="keywords" content="キーワード1,キーワード2,キーワード3,・・・">
<link rel="start" href="start.html">
<link rel="index" href="index.html">
<title>文字列の色を指定する。</title>
</head>
<body text="black" bgcolor="#FFF8DC">
<p><font color="red">日光東照宮(にっこうとうしょうぐう)</font>は栃木県日光市にある神社。<font color="blue">江戸幕府初代将軍徳川家康</font>を神格化した東照大権現を祀る。 日本全国の東照宮の総本社的存在である。正式名称は地名等を冠称しない「東照宮」であるが、他の東照宮との区別のために、 <font color="red">「日光東照宮」</font>と呼ばれることが多い。</p> </body>
</html>
Internet Explorer8での表示例
