When designing a Web page in Div+css, there are always some CSS property precedence issues to encounter. If you do not know the priority level, it is easy to assume that it should be. Here to analyze a problem I encountered, to learn about the attribute priority problem.
Here is the code test code:
<style type= "Text/css" >
<!–
#div1 ul li{List-style:square;}
. div2class ul li{List-style:none;}
–>
</style>
<div id= "Div1" class= "Div1class" >
<div id= "Div2" class= "Div2class" >
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
</ul>
</div>
</div>
The above code is intended to remove the points that are defined by Li by Div2class, and the higher the priority, the more it should be the application. Div2class in the definition, but the actual point is not removed. is not applied. Div2class is also displayed as a setting in the #div1. This proves that the ID priority is higher than class.
A little bit of experience is that the property ID passed through the inheritance takes precedence over class
CSS priority order: Style > ID > Class > Tag > Inherited properties in the same order in tag
Original article reproduced please indicate the source: unstoppable [http://www.dengor.com/archives/618.html]