I am trying to put a 7px border around a page. If the contents don't fill
up the viewport, then the border must appear all around the viewport. If
the page is larger than the viewport, then the border must wrap around the
contents. Both should result in the border around the complete page, no
matter the size, so that none of the bgcolor bleeds outside of it (ie. you
can never see or scroll outside of the border). I would have thought this
would be more common than it is, but anyway...
I am trying to keep to using a doctype, preferably XHTML strict, and I'm
trying to find a method that works in all major browsers. I have tried
styling the html, body, and a 'wrapper' div, and I have tried making each
side of the border a thin div as well. I have tried various ways including
display:table on the body. Some work, some don't - with a doctype.
I have tried wrapping the entire contents in a 100% width and height 1x1
table, and this is the best solution I have found thus far. However, it
only works if the browser is in quirks mode (no doctype specified). If I
specify any doctype using this method, it only works in MSIE 5.
I have read http://www.quirksmode.org/css/100percheight.html but the
author doesn't seem to have put much effort into his 'working' examples -
put a large table in there and it bleeds over the bottom border. Also, I'm
not sure about trusting someone's advice when he chooses to go for the
quirks mode solution - it completely excludes one browser, whereas
strict+body+html+100% is only buggy in one minorer (sp? :-)) browser. And
where are his gecko-based results?
Is there a best method of doing this that doesn't require to be in quirks
mode and doesn't require hacking for specific browsers?
I am testing on Opera 7.23, Firebird 0.7, MSIE 6 (latest updates), MSIE
5.01 (this IS the version that comes with Win98, right?). I have yet to
test with Netscape 4.x.
Cheers.
--
..