CSS
(1)使用样式
-样式优先级:行内样式>内部样式>外部样式
- 行内样式:
<p style="font-size:14px; color:green;">直接在HTML中设置样式</p>
- 内部样式:
<title>内部样式表</title>
<style>
body{
font-size:14px;
color:green;
}
</style>
</head>
- 链接外部样式:
<title>链接外部样式表</title>
<link href="css/common.css" rel="stylesheet" type="text/css" />
</head>
-导入外部样式:
<title>导入外部样式表</title>
<style >
@import url("css/common.css");
</style>
</head>
(2)选择器
- 元素选择器
- 类选择器
- ID 选择器
- 属性选择器
- 后代选择器
- 子元素选择器
- 相邻兄弟选择器
- 伪类
- 伪元素
- 选择器分组