Reputation: 3885
Sometimes you want two body backgrounds. One for the header and one for the footer.
I accidentally discovered that it is possible to style the actual <html>
tag.
HTML:
<html xmlns="http://www.w3.org/1999/xhtml">
CSS:
html {background:#000}
Is it OK to style this, or will it cause any problem?
Upvotes: 13
Views: 2828
Reputation: 29121
Although it's debatable as to whether it's valid [see here]:
For HTML documents, however, we recommend that authors specify the background for the BODY element rather than the HTML element. ...
Many large sites still use it with seemingly consistent results.
Upvotes: 12
Reputation: 14002
It is very common practice. Used all the time on many websites including this one.
Upvotes: 3