1:在head标签中加载一个CSS文件
示例:
<head>
<link
rel
=
"stylesheet"
type
=
"text/css"
href
=
"style.css"
/>
</head>
以下是style.css的内容,此例使用了link标签.
abbr
{
font-size
:
12px
;
}
.text10pxwhite
{
font-size
:
10px
;
color
:
#FFFFFF
;
}
2:直接把CSS内容写在HTML文件的head标签中
示例:
<head>
<style
type
=
"text/css"
>
abbr
{
font-size: 12px;
}
.text10pxwhite
{
font-size: 10px;
color: #FFFFFF;
}
</style>
</head>
此例使用了style标签.以上两种方法是殊途同归的。
3:使用style属性对标签加载样式
示例:
<p
style
=
"font-size: 12px;color: #000;"
>
使用css</p>
此例使用了标签的style属性