Learn Responsive Web Design by Building a Piano - Step 10

I don’t understand why

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

is used. What do the before/after pseudo-elements do, and how is this different to just using the universal selector to set this property?

the answer can be found here:
css - Why use * selector in combination with *::before and *::after - Stack Overflow)%20in%20spacing.

In short, they are needed.

1 Like