Colin-Roberts
25-01-2010, 04:15 PM
float left and float right dont work
index
<!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=iso-8859-1" />
<title>Zetolic Media Group ~ 2010</title>
<link href="styel.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top_container">
<div id="top">
<div id="logo"><a href="index.php" title=""><img src="logo.gif" alt="" width="380" height="99" /></a></div>
</div>
</div>
<div id="promo">
<div id="promotext"></div>
<div class="clear"> </div>
</div>
<div id="leftfloat">
<div id="lefttop">
</div>
<div id="leftmiddle">
</div>
<div id="leftbot">
</div>
</div>
<div id="rightfloat">
<div id="righttop">
</div>
<div id="rightmid">
</div>
<div id="rightbot">
</div>
</div>
</body>
</html>
Style
@import url(reset.css);
#promo{
background:url(../images/promo.jpg) no-repeat;color:#DFF1FF;height:234px;margin:0 0 20px;text-align:left;width:960px;
margin-left: auto; margin-right: auto;
}
#promotext{
float:left;line-height:20px;padding:70px 0 0 40px;width:450px;
}
#top_container{
background:#FFF url(../images/bg_top.gif) repeat-x;height:112px;text-align:center;
}
#top{
height:112px;margin:0 auto;text-align:left;width:960px;
}
body {
background:url(../images/bg.PNG) repeat-x;
margin: 0px 0px 0px 0px;
}
#lefttop {
background: url(../images/lefttop.PNG);
height: 15px;
width: 744px;
margin-top: 6px;
margin-left: 26px;
}
#leftmiddle {
background-color: #F1F1F1;
width: 744px;
margin-left: 26px;
height: 100%;
}
#leftbot {
background: url(../images/leftbot.PNG);
height: 13px;
width: 744px;
margin-left: 26px;
margin-bottom: 26px;
}
#righttop {
background: url(../images/righttop.PNG);
height: 39px;
width: 194px;
margin-top: 6px;
margin-right: 5px;
}
#rightmiddle {
background: url(../images/rightmid.PNG);
width: 744px;
margin-left: 0px;
height: 100%;
}
#rightbot {
background: url(../images/rightbot.PNG);
height: 13px;
width: 744px;
margin-left: 0px;
margin-bottom: 26px;
}
#leftfloat {
float: left;
}
#rightfloat {
float: right;
}
index
<!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=iso-8859-1" />
<title>Zetolic Media Group ~ 2010</title>
<link href="styel.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top_container">
<div id="top">
<div id="logo"><a href="index.php" title=""><img src="logo.gif" alt="" width="380" height="99" /></a></div>
</div>
</div>
<div id="promo">
<div id="promotext"></div>
<div class="clear"> </div>
</div>
<div id="leftfloat">
<div id="lefttop">
</div>
<div id="leftmiddle">
</div>
<div id="leftbot">
</div>
</div>
<div id="rightfloat">
<div id="righttop">
</div>
<div id="rightmid">
</div>
<div id="rightbot">
</div>
</div>
</body>
</html>
Style
@import url(reset.css);
#promo{
background:url(../images/promo.jpg) no-repeat;color:#DFF1FF;height:234px;margin:0 0 20px;text-align:left;width:960px;
margin-left: auto; margin-right: auto;
}
#promotext{
float:left;line-height:20px;padding:70px 0 0 40px;width:450px;
}
#top_container{
background:#FFF url(../images/bg_top.gif) repeat-x;height:112px;text-align:center;
}
#top{
height:112px;margin:0 auto;text-align:left;width:960px;
}
body {
background:url(../images/bg.PNG) repeat-x;
margin: 0px 0px 0px 0px;
}
#lefttop {
background: url(../images/lefttop.PNG);
height: 15px;
width: 744px;
margin-top: 6px;
margin-left: 26px;
}
#leftmiddle {
background-color: #F1F1F1;
width: 744px;
margin-left: 26px;
height: 100%;
}
#leftbot {
background: url(../images/leftbot.PNG);
height: 13px;
width: 744px;
margin-left: 26px;
margin-bottom: 26px;
}
#righttop {
background: url(../images/righttop.PNG);
height: 39px;
width: 194px;
margin-top: 6px;
margin-right: 5px;
}
#rightmiddle {
background: url(../images/rightmid.PNG);
width: 744px;
margin-left: 0px;
height: 100%;
}
#rightbot {
background: url(../images/rightbot.PNG);
height: 13px;
width: 744px;
margin-left: 0px;
margin-bottom: 26px;
}
#leftfloat {
float: left;
}
#rightfloat {
float: right;
}