STYLE 元素 | style 对象
指定页面的样式表。
成员表
下面的表格列出了 style 对象引出的成员。请单击左侧的标签来选择你想要查看的成员类型。
注释
STYLE 元素只能在 HTML 文档的 HEAD 节内使用。Microsoft® Internet Explorer 4.0 及以后版本允许多个样式块。
此元素在 Microsoft® Internet Explorer 3.0 的 HTML 中可用,在 Internet Explorer 4.0 的脚本中可用。
此元素不会被渲染。
此元素需要关闭标签。
示例
下面的例子在 STYLE 元素中包含了样式声明,然后使用 style 对象更改了其中的设置之一。
<HEAD>
<STYLE>
BODY { background-color: white; color: black; }
H1 { font: 8pt Arial bold; }
P { font: 10pt Arial; text-indent: 0.5in; }
A { text-decoration: none; color: blue; }
</STYLE>
</HEAD>
<BODY>
<P id=oParagraph>示例段落文本</P>
<SCRIPT>
oParagraph.style.fontSize = 14;
</SCRIPT>
</BODY>
标准信息
此对象定义在 HTML 3.2
中。