Feb 24, 2011

Header& Footer in a web page

The body tag should be like:



<body>
    <form id="master" runat="server">
        <div id="pageheader"></div>
        <div id="pagebody">
            <div>CONTENT</div>
        </div>
        <div id="pagefooter"></div>
    </form>
</body>
CSS for this tag should be:
body
{
    margin:0px;
    font-family:Calibri;
    font-size:15px;
    padding: 40px 0 25px 0;
    _padding-top:0px; /*for ie 6*/
    overflow:auto;
}
#pagebody
{
    overflow:auto;
    min-width:100%;
    vertical-align:middle;
    text-align:center;
}
#pageheader
{
    position:fixed;
    top:0px;
    left:0px;
    width:100%;
    height:40px;
    border-bottom:1px solid #FF6633;
    background-color:#FFFFFF;
    vertical-align:bottom;
}
#pagefooter
{
    position:fixed;
    _position:absolute;/*for ie 6*/
    bottom:0px;
    left:0px;
    width:100%;
    height:25px;
    border-top:1px solid #FF6633;
    text-align:left;
    vertical-align:bottom;
    background-color:#FFFFFF;
}
Add this section to head:
<!--[if !IE 7]>
    <style type="text/css">
        #pagebody {display:table;height:100%}
    </style>
<![endif]-->


No comments: