CSS级联层级
全局* < 标签 < 类. < id# < 内联inline < !important
同级样式将按执行的先后顺序显示最后应用的。
<html> <head> <title>CSS级联层级</title> <style type="text/css"> /* see CSS code block. */ </style> </head> <body> 00000 <p>11111</p> <p class="red">22222</p> <p class="red purple">22222</p> <p id="blue1" class="red">33333</p> <p style="color:orange;" id="blue2" class="red">44444</p> <p style="color:orange;" class="impor">55555</p> </body> </html>
* { color: brown; } p { color: green; } .red { color: red; } .purple { color: purple; } #blue1{ color: blue; } #blue2{ color: blue; } .impor { color: yellow !important; }