I’m trying to get the following layout: Link to Image
And this is what I’m doing in code:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title></title>
</head>
<body>
<div style="position:absolute; width: 100%; height: 100%" id="container">
<div id='Header'>Header</div>
<div id='Content' style='height:100%; background: gray;'>Content</div>
</div>
</body>
</html>
But this way content gets height of the browser window (parent div), and adds it to first 20 pixels occupied by header, resulting in window scrolling (20px + height of the window == out of the screen). I can use “overflow: hidden” for the content, but I don’t want to give the content extra space.
In WPF I could do this by adding a Grid with two rows (Height=”Auto” and Height=”*”). Maybe I should give up and use tables?
Setting
width: 100%, as you know, will be like settingwidth: <width of the window>.Instead you can set the Content’s edges to be at 0px from the right, left and bottom of the screen.
The CSS of your page will be like this:
This way the page has the same look as the image you provided.