Jump to content

The first two lines of w3.css


nstrudwick

Recommended Posts

Apologies for asking what must be a naive question, but the effect this is having is actually quite important to me.

 

The second line of w3.css reads

 

html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}

I get everything except the * after the first } "-box}* ". No-where can I work out what this is supposed to do. The first element styled is html, the second and third are before and after of everything *, but what is that first * doing please?
Thanks in advance.
Link to comment
Share on other sites

The asterisk selects all elements, the comma is used to apply multiple selectors to the same set of rules. When properly indented the code should look like this:

html {
  box-sizing:border-box
}

*, *:before, *:after {
  box-sizing:inherit
}
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...