Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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?

share|improve this question

closed as off topic by Jalayn, unholysampler, Jim G., ChrisF Aug 21 '12 at 12:59

Questions on Programmers Stack Exchange are expected to relate to software development within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

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. –  M. Dudley 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 Answer 1

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.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.