Home » ★HTMLタグリファレンス

★HTMLタグリファレンス

<STYLE> …… スタイルシートを記述する
Internet Explorer4Internet Explorer5Internet Explorer5-macInternet Explorer5.5Internet Explorer6Internet Explorer7Internet Explorer8Internet Explorer9
Netscape4Netscape6Netscape7Netscape8
Opera6Opera7Opera8Opera9Opera10
Firefox1Firefox2Firefox3Firefox4
Google Chrome1Google Chrome2Google Chrome3Google Chrome4Google Chrome5Google Chrome6
広告



このページでは、HTML4のstyle要素を解説しています。
style要素の最新情報は、以下を参照してください。

<STYLE>タグはスタイルシートを記述するためのタグです。

スタイルシートを利用する際には、<LINK>タグで拡張子が
.css
の外部スタイルシートファイルを読み込む方法と、
<HEAD>~</HEAD>内に<STYLE>タグを用いてスタイルシートを記述する方法と、
各タグにstyle属性の値としてスタイルを指定する方法があります。

<STYLE>タグを用いてスタイルシートを記述する際には、
スタイルシート全体を<!–
–>
でコメントにします。これは、スタイルシートに対応していないブラウザで、
スタイルシートがそのままテキストとして表示されることを避けるためです。

■使用例

HTMLソース

<html>
<head>
<title>文書のタイトル</title>
<meta http-equiv=”Content-Style-Type” content=”text/css”>
<style type=”text/css”>
<!–
body {font-size: 14px;}
p {font-size: 14px;}
div {font-size: 14px;}
td {font-size: 80%;}
td.aka {font-size: 120%; color:#ff0000; font-weight:bold;}

a {text-decoration: none }
a:link {color: #0000ff }
a:visited {color: #800080 }
a:hover {color: #ff0000; text-decoration: underline;
background-color: #ffcc00 }
a:active {color: #0000ff }
a.nasi:hover {background-color:transparent }
–> 
</style>
</head>
<body>
文書の本体
</body>
</html>

■HTML5情報

<style> …… スタイルシートを記述する
広告



Lorem Ipsum is simply dummy text

    By signing up, you agree to our Terms and Privacy Policy. Unsubscribe anytime.