案例:CSS3 案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<style>
5
p:first-child i
6
{
7
background:yellow;
8
}
9
</style>
10
</head>
11
12
<body>
13
14
<p>I am a <i>strong</i> man. I am a <i>strong</i> man.</p>
15
<p>I am a <i>strong</i> man. I am a <i>strong</i> man.</p>
16
17
<p><b>注释:</b>对于 IE8 及更早版本的浏览器中的 :first-child,必须声明 <!DOCTYPE></p>
18
19
</body>
20
</html>
21