当前位置: 首页 > 网络学院 > 网页制作基础教程 > HTML > HTML <style>标签

HTML
HTML 介绍
HTML 元素
HTML 基本标签
HTML 格式
HTML 实体字符
HTML 链接
HTML 框架
HTML 表格
HTML 列表
HTML 表单
HTML 图片
HTML 背景
HTML 颜色
HTML 颜色值
HTML 颜色名
HTML 便条
HTML 布局
HTML 字体
HTML 4.0
HTML 样式

HTML <style>标签


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 455 ::
收藏到网摘: n/a

定义与用法

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>来连接它


在HTML和XHTML中的区别

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
print
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元素将外部样式表导入

评论 (0) All

登陆 | 还没注册?