As I understand it, the elements are the least specific. (vs id element). Please help me in understanding the specifics of selectors in general.
<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;
}
#container {
border: 15px solid orange;
padding: 10px;
}
#firstDiv{
margin: 50px;
border: 5px solid blueviolet;
}
#secondDiv{
border: 5px solid brown;
}
http://jsfiddle.net/t2RRq/
source
share