据我了解,元素是最不具体的。(元素与 ID)。请帮助我理解选择器的特殊性。
<div id="container">
<div id="firstDiv">FIRST Div inside CONTAINER</div>
<div id="secondDiv">SECOND Div inside CONTAINER</div>
</div>
body{
width: 780px;
margin: 20px auto;
}
#container > div:not(:last-of-type){
margin-bottom: 0px; /*How its more specific than ID selector below? */
}
#container {
border: 15px solid orange;
padding: 10px;
}
#firstDiv{
margin: 50px; /*This is not taking effect*/
border: 5px solid blueviolet;
}
#secondDiv{
border: 5px solid brown;
}