Joined January 2013
·

Héctor Gómez

Senior Software Engineer at appear.in
·
Oslo
·
·
·

Posted to Bye Bye CSS Box Model... over 1 year ago

@elad2412 I see, they aren't DOM nodes and therefore * doesn't affect them. Thanks for creating an example.

A lot of people just copy-paste these examples, it would be good to mention that using the pseudoclasses is only necessary if they are using them to actually create elements.

Posted to Bye Bye CSS Box Model... over 1 year ago

@elad2412 But the * selector should already apply to all elements. Why are the pseudoclasses necessary? Does * exclude some elements?

I would like to know if you have experienced corner cases using *, thanks!

Posted to Bye Bye CSS Box Model... over 1 year ago

Nice article, I also agree that border-box is not only the most intuitive but also the most practical. It is worth mentioning that the border-box model is the default in IE and Opera, something that has driven many of us crazy.

My suggestion is to not use the * selector and instead use box-sizing only when it is required: when, in addition to width/height, also border or padding are specified. This doesn't happen as often as you might think.

What can I say about using before and after pseudoclasses with the universal selector: I just don't see the point, but maybe someone can explain it to me...

Achievements
49 Karma
60,315 Total ProTip Views