html - Universal 100% div height -


i'm trying div 100% height. had, wasn't working:

<!doctype html> <html>  <head> </head>   <body>     <div style="height: 100%; border: solid 1px red">         not working     </div>   </body>  </html> 

...but removing <!doctype html> makes work:

<html>  <head> </head>   <body>     <div style="height: 100%; border: solid 1px red">         not working     </div>   </body>  </html> 

it seems version of html set page use affects whether works.

i'm under impression using <!doctype html> thing have @ start, questions these:

1) what's best thing have on first line?

2) given that, how 100% height in div blocks?

many in advance!

yes, should have doctype there! allow divs go 100% height, parents' height needs set. in case:

html, body {    height: 100%; } 

should trick.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -