1、内联样式表: 作为body标签的属性设置CSS
例如:
<body style = "font-size: 20pt; color: blue; ...">
...
</body>
---------------------------------------------------------
2、嵌入样式表:在<head></head>标签之间嵌入<style></style>标签对
设置CSS
例如:
<head>
<style type = "text/css" media = "screen">
<!--
P {font-size: 20pt; color: blue; ...}
-->
</style>
...
</head>
------------------------------------------------------------
3、引用外部样式表:引用外部.css文件
例如:
<head>
<link ref = "StyleSheet" href = "/XXX.css"
type = "text/css" media = "screen">
...
</head>
Notice: ref和href是必选项,type和media是可选项。
-------------------------------------------------------------
4、导入外部样式表
例如:
<head>
<style type = "text/css" media = "screen">
<!--
@ import url(web css文件路径);
@ import url(本地css文件路径);
...
-->
...
</head>
------------------------------------------------------------
Notice:以上4种设置CSS的方法可混合使用。
例如:
<body style = "font-size: 20pt; color: blue; ...">
...
</body>
---------------------------------------------------------
2、嵌入样式表:在<head></head>标签之间嵌入<style></style>标签对
设置CSS
例如:
<head>
<style type = "text/css" media = "screen">
<!--
P {font-size: 20pt; color: blue; ...}
-->
</style>
...
</head>
------------------------------------------------------------
3、引用外部样式表:引用外部.css文件
例如:
<head>
<link ref = "StyleSheet" href = "/XXX.css"
type = "text/css" media = "screen">
...
</head>
Notice: ref和href是必选项,type和media是可选项。
-------------------------------------------------------------
4、导入外部样式表
例如:
<head>
<style type = "text/css" media = "screen">
<!--
@ import url(web css文件路径);
@ import url(本地css文件路径);
...
-->
...
</head>
------------------------------------------------------------
Notice:以上4种设置CSS的方法可混合使用。