サイト内検索

...HTML・XHTMLタグ...

共通属性

スタイルシートを直接指定

スタイルシートを直接指定するには、style属性を指定します。
直接要素(タグ)の中に指定します。
ほとんどの要素(タグ)で指定することができます。
[使い方]
<strong style="color:red;"></strong>
<p style="font-size:3;"></p>
<a href="index.html" style="text-decoration:none;">
リンクの下線を消しました。
</a>
属性 属性値 説明
style="" 「"color: red;"」のように
スタイルシートの内容を指定します。

サンプル

《styleを使って》

[bodyの中]

<h2 style="color: green;">見出しの文字は緑です。</h2>
<strong style="font-size:20px; color:green;">
文字のサイズは20px・色は緑です。
</strong>
<p style="border:double 5px green; width: 450px;">
ボーダーの幅は5px・長さは450px・色は緑です。
</p>

[ブラウザ上]

見出しの文字は緑です。


文字のサイズは20px・色は緑です。

ボーダーのボーダーの幅は5px・長さは450px・色は緑です。


Copyright c 2007.10.01 luc All rights reserved.