One of our colleagues added a font size style to be applied on the HTML tag. I never saw this in any course or tutor on CSS, so I was wondering if this is W3C compliant and if it has any effect on the content ...
You can not add any styles to the <html> tag. But there's a way to change the font color etc with HTML. http://www.w3schools.com/html/html_fonts.asp It's better to use CSS though
In html, the only attributes allowed are lang and dir. Otherwise, there is nothing magical about the html element. It readily accepts styling, and all (to my knowledge) graphic browsers that support css allow it. It is not rare, for example, to see background images, colors, etc., used on both html and body elements. cheers, gary
You can apply styles to the HTML element; however it is not supported by every modern browser. Some browsers will allow you to apply some styles to it that others won't. As for fonts, it's best to apply them to the body instead. Not only do most Web designers expect them to be there, but it also happens to be the HTML element that contains all the page content anyway, so why would you even bother placing them elsewhere?
Thanks for the answers all I agree with you Dan, that it is best to apply the base styles to the <body> tag. In the example that my colleague created, the style that was applied to the <html> tag (font-size) had an effect on the page ... I don't think it's common practice to apply styles to the HTML tag though.