多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
# HTML style 属性 [HTML 全局属性](/tags/html_ref_standardattributes.asp) ## 实例 在 HTML 文档中使用 style 属性: ``` <h1 style="color:blue; text-align:center">This is a header</h1> <p style="color:red">This is a paragraph.</p> ``` (可以在本页底部找到更多实例) ## 定义和用法 style 属性规定元素的行内样式(inline style) style 属性将覆盖任何全局的样式设定,例如在 &lt;style&gt; 标签或在外部样式表中规定的样式。 ## 支持 W3C: "W3C" 列指示 W3C 的 HTML/XHTML 推荐标准中是否定义了该属性。 | IE | Firefox | Opera | Safari | W3C | | --- | --- | --- | --- | --- | | YES | YES | YES | YES | YES | ## 语法 ``` <element style="_value_"> ``` ### 属性值 | 值 | 描述 | | --- | --- | | *style_definition* | 一个或多个由分号分隔的 CSS 属性和值。 | [HTML 全局属性](/tags/html_ref_standardattributes.asp)