Forum Moderators: not2easy
IE :-
<snip>
FF :-
<snip>
HTML :-
<div class="wrapper">
<div class="l_sidebar">
<div class="l_block">
<h2 class="h2_block"><img src="images/menu.png"></h2>
menu<br>menu
<div class="l_block">
<h2 class="h2_block"><img src="images/cats.png"></h2>
<?=Showtest();?>
</div>
</div>
<div style="width:15px; background-color:red; float:left;">f</div>
<div class="conent">
<?=showconent();?>
</div>
<div class="r_sidebar">
<div class="r_block">
<h2 class="h2_block"><img src="images/top_stories.png"></h2>
<?=Showtext();?>
</div></div>
CSS :-
.l_sidebar{float:left; width:150px; margin-bottom:10px;}
.l_block{text-align:left; float:left; width:148px; margin-top:10px; background-color:#fff; border: 1px #adadad solid; padding-left:4px; padding-right:4px; padding-bottom:4px;}
.r_sidebar{float:right; width:188px; margin-top:10px; }
.r_block{text-align:left; background-color:#fff; border: 1px #adadad solid; margin-bottom:10px; padding-left:4px; padding-right:4px; padding-bottom:4px;}
.content{ margin-top:10px; margin-left:0px; margin-right:0px; width:430px; float:left; margin-top:10px;}
hope some one can help? thanks!
[edited by: swa66 at 8:17 pm (utc) on June 4, 2009]
[edit reason] No personal URLs please see forum charter and ToS [/edit]
if that works and you still need some spacing try using padding on the l_block, r_block instead
here's the code I'm using, I'm guessing where you wanted the left sidebar div closed, removed the wrapper div, and added some colors.. let us know if that's the right picture now..
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> Page Title </title>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<style type="text/css" media="screen">
.l_sidebar{
float:left;
width:150px;
margin-bottom:10px;
background: #cfc;
}.l_block{
text-align:left;
float:left;
width:148px;
margin-top:10px;
background-color:#ff0;
border: 1px #adadad solid;
padding-left:4px; padding-right:4px; padding-bottom:4px;
}
.r_sidebar{float:right; width:188px; margin-top:10px; }
.r_block{text-align:left; background-color:#fff; border: 1px #adadad solid; margin-bottom:10px; padding-left:4px; padding-right:4px; padding-bottom:4px;}.content{ margin-top:10px; margin-left:0px; margin-right:0px; width:430px; float:left; margin-top:10px;}
/*h2 {margin: 0;}*/
</style>
</head>
<body><div class="l_sidebar">
<div class="l_block"><h2 class="h2_block">h2</h2>left block<br>menu
<div class="l_block">
<h2 class="h2_block">h2</h2>
<p>left block</p>
</div>
</div>
</div><div style="width:15px; background-color:red; float:left;">f</div>
<div class="content">
<p>some content</p>
</div><div class="r_sidebar">
<div class="r_block">
<h2 class="h2_block"><img src="images/top_stories.png"></h2>
<p>right block</p>
</div>
</div></body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> Page Title </title>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<style type="text/css" media="screen">
html, body, form {font:12px/17px Arial, Helvetica, sans-serif; background-color: #fff; color:#000; margin-right:auto; margin-left:auto;}
.wrapper{text-align:center; width:800px; margin-left: auto; margin-right: auto;}
.l_sidebar{
float:left;
width:150px;
margin-bottom:10px;
background: #cfc;
}.l_block{
text-align:left;
float:left;
width:148px;
margin-top:10px;
background-color:#ff0;
border: 1px #adadad solid;
padding-left:4px; padding-right:4px; padding-bottom:4px;
}
.r_sidebar{float:right; width:188px; margin-top:10px; }
.r_block{text-align:left; background-color:#fff; border: 1px #adadad solid; margin-bottom:10px; padding-left:4px; padding-right:4px; padding-bottom:4px; background-color:green;}
.content{ margin-top:10px; margin-left:0px; margin-right:0px; width:430px; float:left; margin-top:10px; background-color:black; color:#FFF;}
/*h2 {margin: 0;}*/
</style>
</head>
<body>
<div class="wrapper">
<div class="l_sidebar">
<div class="l_block"><h2 class="h2_block">h2</h2>left block<br>menu
</div>
</div>
<div style="width:15px; background-color:red; float:left;">f</div>
<div class="content">
<p>some content</p>
</div>
<div class="r_sidebar">
<div class="r_block">
<h2 class="h2_block"><img src="images/top_stories.png"></h2>
<p>right block</p>
</div>
<div style="clear:both;"></div><br/>
</div>
</body>
</html>
It, the "f" block is next to the left sidebar, if you make the
.l_block have a top margin of 100px instead of the 10px that's on it now you will be able to 'see' that it is aligning perfectly with the left sidebar (light green color) both left side and top all the other blocks do have default and explicit margins coming into play hence they all appear to be aligned a little lower, but the top of the left sidebar is the top.
the F block is 'overlapping' the left blocks because they are actually out of the flow (floated inside the left sidebar) and they are actually wider than the sidebar itself because of their padding and borders, you should see this once you move them down a bit. The "f" block does not know these internal (yellow) blocks exist so it is aligning with the light green sidebar edge.