css 选择器样式优先级

 !important > 行内 >id > class >tag >*    

 

 

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>css优先级</title>
<style>
#box{
color: red !important
}
.box{
color: yellow
}
p{
color: blue
}
*{
color: green
}

</style>
</head>
<body>
<p class="box" id="box" style="color: orange"> css 选择器优先级</p>
</body>

</html>

posted @ 2016-04-14 15:28  Jinsuo  阅读(116)  评论(0编辑  收藏  举报