案例:CSS案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
<html>
3
<head>
4
<style type="text/css">
5
[title~=hello]
6
{
7
color:red;
8
} 
9
</style>
10
</head>
11
12
<body>
13
<h1>可以应用样式:</h1>
14
<h2 title="hello world">Hello world</h2>
15
<p title="student hello">Hello W3xue students!</h1>
16
<hr />
17
18
<h1>无法应用样式:</h1>
19
<h2 title="world">Hello world</h2>
20
<p title="student">Hello W3xue students!</p>
21
</body>
22
</html>
23