Forum Moderators: open
div {
position: absolute;
height: 100%;
width: 20%;
background-color: red;
}
As far as I can tell sifting through the W3C the above is valid code. With doctype declared (any flavor) IE will display the division only as high as your text. On Mozilla it will display as 100% of the page as you'd expect even if the div is empty. However, when no doctype is declared - the doc just begins with <html> - the div's will display in IE as they do in Mozilla.
Has anyone else run into this? Is this an oversight on IE's part? Is this not valid?
IE offers the least support for CSS1 & CSS2 among the modern "Web Standard Browsers." IE depends on content to determine height and ignores the height% value. It will be quite awhile (unfortunately) before percentage heights will be practical for general use.
[w3.org...]