I am trying to make a web page similiar to this: NFL in that i want it to have a fixed middle section with the left and right sides filling in any gaps for the wider browsers.
i didnt want to use frames as ive read somewhere that thats not really recommended.
I tried using different sections to do it such as a header, footer, left, right, content_area and large wrapper but it doesnt quite click.
Heres the bits of code that i have so far:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://w3.org/1999/xhtml" xml:lang="en"> <head> <title>Fixed layout sheet</title> <link href="layout.css" rel="stylesheet" text="text/css" /> </head> <body> <div id="header">header</div> <div id="wrapper"> <div id="content">content</div> <div id="left">left</div> <div id="right">right</div> </div> <div id="footer">footer</div> <p> </p> </body> </html>
and the style sheet:
body{
margin:0;
padding:;
}
#header {
float:left;
width:100%;
background-color:#FF00FF;
}
#footer {
float:left;
width:100%;
background-color:#FF00FF;
}
#wrapper{
border: 1px solid black;
width:1000px;
margin:20px auto;
text-align:left;
overflow:hidden;
}
#left {
position:relative;
float:left;
width:200px;
background-color:#000000;
right:200px;
margin-left: -100%;
margin-bottom:-2000px;
padding-bottom:2000px;
}
#right {
position:relative;
float:left;
width:125px;
background-color:#00FF00;
margin-right: -100%;
margin-bottom:-2000px;
padding-bottom:2000px;
}
#content {
float:left;
background-color:FF0000;
width:100%;
margin-bottom:-2000px;
padding-bottom:2000px;
}
Oh and sorry for the messy code.

New Topic/Question
Reply



MultiQuote




|