So ive been doing html for a little while now.. but I keep running into issues when I use margins. This causes me to usually just use padding.
Anyway, let me give you an example of something I am working on currently.
http://vasoshield.xcsit.com/index.html
Main structure :
<div id="main">
<div id="header">
<div id="mainNav">
main navigation...
</div>
</div>
<div id="content">
page content...
</div>
</div>
#main {
margin: 0 auto;
width: 745px;
padding-left: 175px;
padding-right: 50px;
background: url(../images/white_bg.jpg) no-repeat top left;
position: relative;
}
#header {
height: 210px;
}
#mainNav { margin-top: 175px; }
The problem is.. I put margin-top: 150px on the "mainNav" div.. and instead of pushing down 150px from "header" div.. the whole page gets moved down. So the "main" div actualy gets pushed down 150px.. I dont understand why!! If I use padding-top: 150px for "mainNav" div, it actually uses the "header" div to push down from.
Does my question make sense?
I am sure there is some sort of rule I just dont know about. Thanks ahead of time!!