Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

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
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, where this would be on-topic. – Peter Taylor Aug 21 '12 at 12:58

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.