The thing seems not relevant but can actually changes other things
Hi there, I had learnt a CSS pseudo selector(or called pseudo class?) button:not(:last-child) {background-color:red;} which I think this code should turn all of the button into red background except the last. when I apply this to the code below: <body> <p>Some Text</p> <button>Btn</button> <button>Btn</button> <button>Btn</button> <button>Btn</button> <p>Some Text</p> </body> I see all of the button colored, then I wrap buttons inside a <div> tag: <body> <p>Some Text</p> <div> <button>Btn</button> <button>Btn</button> <button>Btn</button> <button>Btn</button> </div> <p>Some Text</p> </body> I see actually what I wanted. Why this action can solve the problem? I mean CSS selector "button:not(:last-child)" should have leave the last button uncolored regardless if I have wrap the <div> tag around the button tags. Is there any other problem like this in CSS?