kristofdielis
Programmer
- Sep 1, 2011
- 25
Hi,
I have a simple masterpage structure, one div for the menu and one for content. The Menu div has a fixed height, the content should take 100%:
The menu works fine, the divMasterContent however does not take full screen.
The CSS:
What can I do to have #divMasterContent take 100% of the available screen-space, without causing scrolling (and having the padding I want)?
Thx.
I have a simple masterpage structure, one div for the menu and one for content. The Menu div has a fixed height, the content should take 100%:
Code:
<div id="divMasterMenu">
<span class="MasterMenuItemSelected"><a href="">Menu 1</a></span>
<span class="MasterMenuItem"><a href="">Menu 2</a></span>
</div>
<div id="divMasterContent">
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
The menu works fine, the divMasterContent however does not take full screen.
The CSS:
Code:
body
{
background-color: #00FF00;
font-family: Verdana;
font-size: medium;
padding: 1em;
height: 100%;
}
#divMasterMenu
{
position: relative;
width: 100%;
float: right;
}
/* This does NOT work correctly!! */
#divMasterContent
{
position: relative;
top: 40px;
width: 100%;
height: 100%;
background-color: White;
padding: 5px 5px 10px 5px;
vertical-align: top;
}
#divMasterMenu .MasterMenuItem
{
color: #00FF00;
background-color: White;
padding: 1em;
font-weight: bold;
}
#divMasterMenu .MasterMenuItemSelected
{
color: #000000;
background-color: #afeeee;
padding: 1em;
font-weight: bold;
}
What can I do to have #divMasterContent take 100% of the available screen-space, without causing scrolling (and having the padding I want)?
Thx.