im currently constructing a website in css and Im having a few issues
With the area within the #mainArea tag.
I've placed 3 divs in there and floated the ma1 id left ma2 none ma3 right
Now the left and right seems to work nicely but the center tag keeps wanting to push into the ma1 tag
i guess its something to do with the float I've tried to clear any above float properties and I get a few results none the one I'm after though. Ie 3 divs that align side by side to each other ma1 and ma2 keep trying to wrap around each other.
Heres the code im using.
Any help will be much appreciated.
With the area within the #mainArea tag.
I've placed 3 divs in there and floated the ma1 id left ma2 none ma3 right
Now the left and right seems to work nicely but the center tag keeps wanting to push into the ma1 tag

Heres the code im using.
Any help will be much appreciated.
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
html, body, h1, h2, h3, h4, h5, h6, p, ol, ul, li, pre, code, address, variable, form, fieldset, blockquote {
padding: 0;
margin: 0;
font-size: 100%;
font-weight: normal;
}
table { border-collapse: collapse; border-spacing: 0; }
td, th, caption { font-weight: normal; text-align: left; }
img, fieldset { border: 0; }
ol { padding-left: 1.4em; list-style: decimal; }
ul { padding-left: 1.4em; list-style:square; }
q:before, q:after { content:''; }
body {
background-color: #e1dcea;
}
#background {
background-image: url(Images/bg.jpg);
background-repeat: no-repeat;
width: 1128px;
margin-right: auto;
text-align: left;
margin-left: auto;
}
#content {
width: 906px;
margin-right: auto;
margin-left: auto;
text-align: center;
height: 1000px;
background-color: #FFF;
background-image: url(Images/bg__content_center.jpg);
background-repeat: no-repeat;
padding-top: 10px;
}
#header {
width: 856px;
height: 88px;
margin-right: auto;
margin-left: auto;
background-color: #FFF;
border: 1px solid #CCC;
margin-top: 0px;
}
#headerLinks {
float: left;
width: 400px;
padding: 0;
margin-top: 0;
margin-right: auto;
margin-bottom: 0;
margin-left: auto;
}
#headerLinks ul {
margin: 0;
padding: 48px 0px 0px 0px;
list-style: none;
line-height: normal;
}
#headerLinks li {
float: left;
}
#headerLinks a {
display: block;
margin-right: 1px;
text-decoration: none;
text-align: center;
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
font-weight: bold;
color: #999;
border: none;
background-color: #FFF;
padding-top: 18px;
padding-right: 15px;
padding-bottom: 0px;
padding-left: 15px;
}
#headerLogo {
float: right;
padding-right: 12px;
padding-top: 10px;
}
#mainArea {
margin-top: 10px;
width: 856px;
border: 1px solid #CCC;
margin-right: auto;
margin-left: auto;
height: 328px;
}
#ma1 {
float: left;
width: 200px;
}
#ma2 {
width: 200px;
}
#ma3 {
float: right;
width: 100px;
}
#footer {
text-align: center;
background-color: #a496bf;
height: 134px;
margin-right: auto;
margin-left: auto;
}
#footerContent {
text-align: left;
background-color: #b3a7ca;
height: 134px;
margin-right: auto;
margin-left: auto;
width: 906px;
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
color: #FFF;
}
#footerAddress {
float: left;
margin-top: 40px;
margin-left: 27px;
}
.footerBrandName {
color: #4a3084;
}
#footerMdTel {
float: right;
margin-top: 40px;
margin-right: 27px;
}
</style>
</head>
<body>
<div id="background">
<div id="content">
<div id="header">
<div id="headerLinks">
<ul>
<li><a href="#">HOME</a></li>
<li><a href="#">CONTACT US</a></li>
<li><a href="#">SITE MAP</a></li>
</ul>
</div>
<div id="headerLogo"><img src="Images/concentrics_lettings_logo.jpg" width="292" height="72" alt="Concentrics Lettings Logo" /></div>
</div>
<div id="mainArea">
<div id="ma1">Content for New Div Tag Goes Here</div>
<div id="ma2">Content for New Div Tag Goes Here</div>
<div id="ma3">Content for New Div Tag Goes Here</div>
</div>
</div>
</div>
<div id="footer">
<div id="footerContent">
<div id="footerAddress"><strong class="footerBrandName">Address Line One</strong><br />
Address Line Three<br />
<strong>Address Line Three</strong></div>
<div id="footerMdTel">Content for New Div Tag Goes Here</div>
</div>
</div>
</body>
</html>
Last edited: