<html>
<head>
<title> 选择器优先级的比较 </title>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8"/>
<style>
p{
color:red;
}
.green{
color:green;
}
#red{
color:red;
}
</style>
</head>
<body>
<!--标签选择器和类选择器-->
<b><p class="green">1.类选择器优先于标签选择器</p></b>
<!--ID选择器和类选择器和标签选择器-->
<b><p id="red" class="green">2.ID选择器优先于类选择器和标记选择器</p></b>
<b><p id="red" style="color:purple">3.行内式样式优先于ID选择器</p></b>
</body>
</html>