aaronoafc
02-08-2012, 05:37 PM
Thanks to the help of people on here I've managed to create a layout I quite like however the main body as you will see if you run the code is squashed up in the middle. I have tried adding a "height:600px" or whatever to the css however It moved the left and right navigation down, How do I do it so that it can all fit on the page?
HTML
<!doctype html>
<head>
<link href="styles.css" type="text/css" rel="stylesheet""
</head>
<body>
<div id="container">
<h1>Oldham Athletic Website</h1>
<p><a href="http://oldhamathletic.co.uk" class="oafcpage">Oldham Athletic Official Website</a></p>
<div class="mainbody">Main body of the website</div>
<div class="leftnav">Left navigation</div>
<div class="rightnav">right navigation</div>
</div>
</body>
</html>
CSS
body {
background-color:#0099FF;
font-size:100%;
}
h1 {
c olor:#ffffff;
text-align:center;
font-family:Arial;
font-size:1.75em;
border:2px solid white;
}
.oafcpage{
text-align:center;
font-family:arial;
}
.oafcpage:link {
text-decoration:none;
}
.oafcpage:hover {
color:white;
}
div.mainbody {
width:600px;
margin:0 auto; /*this is the bit that centers it*/
padding: 10px;
overflow: auto; /*clears floats*/
border:3px solid white;
text-align:center;
}
div.leftnav {
float:left;
width:250px;
height:475px;
padding:10px;
border:3px solid white;
margin:0px;
}
div.rightnav {
float:right;
width:250px;
height:475px;
padding:10px;
border:3px solid white;
margin:0px;
}
Editing the div tag "mainbody" makes the two navigation bars go lower meaning the user would have to scroll to see them but I want it so they are all aligned and the "main body" is stretched to fit the space inbetween the two navigation bars.
Thanks in advance
HTML
<!doctype html>
<head>
<link href="styles.css" type="text/css" rel="stylesheet""
</head>
<body>
<div id="container">
<h1>Oldham Athletic Website</h1>
<p><a href="http://oldhamathletic.co.uk" class="oafcpage">Oldham Athletic Official Website</a></p>
<div class="mainbody">Main body of the website</div>
<div class="leftnav">Left navigation</div>
<div class="rightnav">right navigation</div>
</div>
</body>
</html>
CSS
body {
background-color:#0099FF;
font-size:100%;
}
h1 {
c olor:#ffffff;
text-align:center;
font-family:Arial;
font-size:1.75em;
border:2px solid white;
}
.oafcpage{
text-align:center;
font-family:arial;
}
.oafcpage:link {
text-decoration:none;
}
.oafcpage:hover {
color:white;
}
div.mainbody {
width:600px;
margin:0 auto; /*this is the bit that centers it*/
padding: 10px;
overflow: auto; /*clears floats*/
border:3px solid white;
text-align:center;
}
div.leftnav {
float:left;
width:250px;
height:475px;
padding:10px;
border:3px solid white;
margin:0px;
}
div.rightnav {
float:right;
width:250px;
height:475px;
padding:10px;
border:3px solid white;
margin:0px;
}
Editing the div tag "mainbody" makes the two navigation bars go lower meaning the user would have to scroll to see them but I want it so they are all aligned and the "main body" is stretched to fit the space inbetween the two navigation bars.
Thanks in advance