HTML元素 - style

定义

指定页面的样式表。

Specifies a style sheet for the page.

注释

STYLE 元素只能在 HTML 文档的 HEAD 内使用。Microsoft Internet Explorer 4.0 及以后版本允许多个样式块。

此元素在 Internet Explorer 3.0 及以上版本的 HTML 中可用,在 Internet Explorer 4.0 及以上版本的脚本中可用。

此元素不会显示。

此元素需要关闭标签。

The STYLE element should appear in the HEAD section of an HTML document. Microsoft Internet Explorer 4.0 and later permit multiple style blocks.

This element is available in HTML as of Internet Explorer 3.0, and in script as of Internet Explorer 4.0.

This element is not rendered.

This element requires a closing tag.

示例代码

<HTML>
<HEAD>
<STYLE type="text/css">
H1 {border-width:1; border:solid; text-align:center; color:red;}
</STYLE>
</HEAD>
<BODY>
<H1> 这个标题使用了Style。</H1>
</BODY>
</HTML>

相关教程与示例代码

CSS(Cascading Style Sheets)简介