<p style="font-size: 12pxfont-weight:boldfont-style:italiccolor:red">By adding inline CSS styling to the></p>
2.嵌入样式 嵌入样式的应用范围仅限于当前页面。页面样式会覆盖外部样式表中的样式,但会被行内样式覆盖。
<head>
<style type="text/css">
h1 {font-size:16px}
p {color:blue}
</style>
</head>
3.链接样式
<link href="styles.css" rel="stylesheet" type="text/css" />
样式的写法
例子如下
1 ) p {color:redfont-size:12pxfont-weight:bold}
2 ) h1 {color:bluefont-weight:bold}
h2 {color:bluefont-weight:bold}
h3 {color:bluefont-weight:bold}
3)假设,你在写完前面那条规则后,又想只把h3变成斜体,那可以再为h3写一条规则:
h1, h2, h3 {color:bluefont-weight:bold}
h3 {font-style:italic}