1

I am reading a CSS book and come cross the following snippet,

html {
  box-sizing: border-box;
}

*, *:before, *:after {
  box-sizing: inherit;
}

My understanding of * is that it selects all the elements. So I do not get what is *:before and *:after.

Also the book says, the snippet above applies border-box sizing to every element by default, without affecting the box-sizing behavior of existing parts of your project. I also do not quite understand this. Hope someone can help me explain.

Thanks!

CodingFanSteve
  • 713
  • 2
  • 6
  • 17

0 Answers0