style

Form

<style> ... </style>

Attributes

attribute default description
id none specifies the unique ID
type none specifies the style sheet type
media none specifies the media type for the style information has been designed

Support

HTML 3.2, HTML 4.01 [STF], XHTML 1.0 [STF], XHTML 1.1
Microsoft (MSDN)
[IE3 or later][Firefox 1 or later][Safari 1 or later][Opera 6 or later][Netscape 4 or later]

Explanation

The style tag specifies a style sheet. To prevent browsers which don't support style sheets from display the style information, embed it within the comment tag (<!-- ... -->). The style sheets is described in other files, and if you wish to use the sheets loaded from the files, use the <link> tag.

Related Tags

link

Sample Code [Output]

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=shift_jis">
<title>Sample</title>
<style tye-"text/css"><!--
p { border-color:1px solid black;
font-size:90%;
color:red;
}
--></style>
</head>
<body>
<h1>Sample</h1>
<p>
You can specify font colors.
</p>
</body>
</html>