I was playing around with css and discovered problems in browsers like ie7 with margins, I ended up styling the html tag in the css for things to look good. How is it that the html tag can be styled when the body tag is supposed to be the start of the visible portion of a html document?
Share
Actually, in terms of CSS, the viewport is the canvas where all the contents of a page are drawn, followed by
html, the root of an HTML document, followed bybody, the document body. Thebodyelement may be the start of an HTML document where visible content may be placed, but it’s not the root of the view canvas, at least as far as CSS is concerned.And for that matter, even
headand its contents may be styled, not justhtml,bodyand the contents ofbody. In fact, browsers that implement CSS actually have to applydisplay: noneto theheadelement in their user agent stylesheets in order to hide it.