Hi all thanks for reading,
I am having problems getting my padding to work how i would like. I have a the followinc code for my page
<!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>Sonc Hydro</title>
<link rel="stylesheet" type="text/css" href="css/main_styles.css" />
<link rel="stylesheet" type="text/css" href="css/main_layout.css" />
</head>
<body bgcolor="#08a2c0">
<div id="container">
<div id="body">
<div id="header">
<h4>sonic hydro</h4>
</div>
<div id="nav">
<h4>navigation</h4>
</div>
<div id="body_main">
<div class="body_panel">
<h4>main body</h4>
</div>
<div class="body_panel">
<h4>main body 2</h4>
</div>
<div class="body_panel">
<h4>main body 3</h4>
</div>
<br />
<div class="body_panel">
<h4> main body 4</h4>
</div>
<div class="body_panel">
<h4>main body 5</h4>
</div>
<div class="body_panel">
<h4>main body 6</h4>
</div>
<div class="clear"></div>
</div>
<div id="footer">
<h4>address</h4>
</div>
</div>
</div>
</body>
</html>
i would like the div class="body_panel" to have a padding around it but i am having no joy in getting it to work, i have the following css for the div tags
#body_main{
width : 95%;
margin-left : auto;
margin-right : auto;
background-color : #96C;
border-left : solid #FFF;
border-right : solid #FFF;
padding : 5px;
}
.body_panel{
width : 25%;
border : solid #FFF;
padding : 5px;
float : left;
}
i am getting padding on the inside of the body_main but then the padding around the body_panel will not work, take a look at the attached image for what i am left with.
i am not sure if i am causing a problem as i am trying to put padding on the body_main and then trying to then set the padding on the body_panel which i s a child of body_main (i think not to up on css), but even if i try to just set the padding on the body_main i am still not getting the padding around body_panel.
ant help with this would be really helpfully or even a pointer to a good tutorial which will show me the way forward with this problem.