Jump to content

The first two lines of w3.css


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 post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...