4

I have the following:

html {
overflow-y: scroll;
}

body {
font-family: Georgia, "Times New Roman", serif;
font-size: 1.125em;
line-height: 1.5em;
margin: 0 auto;
max-width: 41em;
}

Which attributes should be with the HTML section, and which within the BODY section?

  • 1
    Doesn't matter for this case. It might make a difference depending on the rest of your css. – zzzzBov Aug 17 '12 at 18:11
  • 3
    Semantically speaking, it doesn't make sense to put any styles on "head", and thus it doesn't make sense to put any styles on "html". "html" is not a content-level element. All styles should go on "body" or a descendant of "body". – Ben Lee Aug 20 '12 at 21:44
  • @BenLee: You should turn your comment into an answer. – sourcenouveau Aug 21 '12 at 11:44
  • Flagged to migration to webmasters.stackexchange.com, where this would be on-topic. – Peter Taylor Aug 21 '12 at 12:58

1 Answers1

0

I'm not 100% on which is technically or traditionally correct, but I've used them in a similar way to your example code without issue.

Therefore I'd say that there shouldn't be any side effects by doing it this way, but it may not strictly meet the standard.

shauneba
  • 735