Question about the pre-existing code


#1

Why does the style.css start with
html,
I’ve never seen that before.


#2

html is how you put words on your website i will try to invite a moderator to help you answer this


#3

I know what html is, I’ve just never seen “html” followed by a comma in a css file before.


#4

hope a moderator replies then i invited stetim but he may not be on right now


#5

You’ll find many different selectors within a CSS sheet.

from * { }
to
div > ul > li > a:hover { }

html enables you to control the document as a whole.

Consider this, an HTML document is made of parents, children, grand-children…

<html>
  <body>
    <div>
    </div>
  </body>
</html>

That should give you an idea of where html stands within the CSS sheet, and what it can do.

If html has a comma, it must be accompanied by at least one other selector.
What was it, in this case? and what does it do?


#6

thanks for answering this question


#7

i was indeed not online.

well, html can used as a css selector. To set a background image/color for the entire page.

the comma does indeed indicate multiple elements specified:

html, body {
   margin: 0;
}

this will ensure no margin on the edge of the page (which is present by default)