当前位置: 首页 > 网络学院 > 网页制作基础教程 > HTML > HTML <style>标签
Defines a style in a document.
为文档定义样式
The style element goes in the head section. If you want to include a style sheet in your page, you should define the style sheet externally, and link to it using <link>.
style元素可以在head区域使用。如果你想要将外部的样式表放到你的页面里,可以定义一个外部的样式表,并用<link>来连接它
NONE
无
Tip: To learn more about style sheets, visit our CSS Tutorial.
提示:要学习有关样式表,可以访问我们的CSS教程
代码 |
---|
<head> <style type="text/css"> h1 {color: red} h3 {color: blue} </style> </head> |
DTD indicates in which DTD the attribute is allowed. S=Strict, T=Transitional, and F=Frameset.
下表中的DTD列指明了被支持的DTD属性。S=Strict(精确的),T=Transitional(传统的),F=Frameset(框架)
属性 | 值 | 描述 | DTD |
---|---|---|---|
type | text/css | Defines the content-type 定义content-type | STF |
属性 | 值 | 描述 | DTD |
---|---|---|---|
media | screen tty tv projection handheld braille aural all | The destination medium for the style information 样式信息所针对的媒介 | STF |
title, dir, lang, xml:space |
For a full description, go to Standard Attributes.
查看完整的属性
Styles in HTML
How to format an HTML document by using the style element.
如何使用style元素来格式化HTML文档
Link that is not underlined
How to make a link that is not underlined by using the style attribute.
通过使用style属性使得连接不带有下横线
Link to an external style sheet
How to link to an external style sheet by using the link element.
使用link元素将外部样式表导入