フォントスタイル要素 %fontstyle; (fontstyle)

 
インライン要素
ホーム > HTML Note > フォントスタイル要素
 

%fontstyle;

tt 等幅 H2- ie1- N1-
-- teletype or monospaced text style --
i 斜体 H2- ie1- N1-
-- italic text style --
b 太字 H2- ie1- N1-
-- bold text style --
u 下線 (非推奨) H3-x1 ie1- N3-
-- underlined text style --
s 削除線 (非推奨) H4-x1 ie1- N3-
-- strike-through text style --
strike 削除線 (非推奨) H3-x1 ie1- N1-
-- strike-through text --
big 文字大 H3- ie3- N1-
-- large text style --
small 文字小 H3- ie3- N1-
-- small text style --

説明

<%fontstyle;>-</%fontstyle;> 開始タグ:必須 終了タグ:必須
フォントスタイル要素(%fontstyle;)は、見た目のスタイルを表現する要素のグループです。

視覚的整形に用いる要素や属性のほとんどは推奨されていません。代わりにスタイルシートを用いることが推奨されています。
 

属性 (W3C)

<%fontstyle;
一般属性 id class style title lang dir %events;
>(%inline;)*</%fontstyle;>

使用例

テレタイプ (等幅)
イタリック (斜体)
ボールド (太字)
アンダーライン (下線)
ストライクスルー (削除線)
ストライクスルー (削除線)
ビッグ (文字大)
スモール (文字小)
<tt>テレタイプ (等幅)</tt><br>
<i>イタリック (斜体)</i><br>
<b>ボールド (太字)</b><br>
<u>アンダーライン (下線)</u><br>
<s>ストライクスルー (削除線)</s><br>
<strike>ストライクスルー (削除線)</strike><br>
<big>ビッグ (文字大)</big><br>
<small>スモール (文字小)</small>
ブラウザにより描画(レンダリング)は異なります。
 
 

スタイルシートによる記述



非推奨要素に代わるスタイルシートの記述には様々な方法がありますが、ひとつには、下記のように、<head>-</head>内にstyle要素を配置することで適用することができます。
<html>
<head>
<style type="text/css"><!--
.tt_s     {font-family:monospace; font-size:smaller;}  /* tt */
.i_s      {font-style:italic;}             /* i */
.b_s      {font-weight:bold;}              /* b */
.u_s      {text-decoration:underline;}     /* u */
.s_s      {text-decoration:line-through;}  /* s */
.strike_s {text-decoration:line-through;}  /* strike */
.big_s    {font-size:larger;}              /* big */
.small_s  {font-size:smaller;}             /* small */
--></style>
</head>

<body>
<span class="tt_s">テレタイプ (等幅)</span><br>
<span class="i_s">イタリック (斜体)</span><br>
<span class="b_s">ボールド (太字)</span><br>
<span class="u_s">アンダーライン (下線)</span><br>
<span class="s_s">ストライクスルー (削除線)</span><br>
<span class="strike_s">ストライクスルー (削除線)</span><br>
<span class="big_s">ビッグ (文字大)</span><br>
<span class="small_s">スモール (文字小)</span>
</body>
</html>
*1 ブラウザによってデフォルトの文字サイズが異なる要素もあります。フォントサイズの指定には、スタイルシートのfont-sizeプロパティを用います。
 
関連要素: %fontstyle; | %phrase; | sub|sup | span | bdo | basefont | font | br
トップページ HTML Note ページトップ
 2003/06/22発行 2008/01/01更新