html - top margin is not working inside div -
i have 2 divs..
css
#content { background: url('../images/bg.jpg') no-repeat left; width: 100%; height: 811px; } #welcome { background: #fff; width: 600px; height: 50px; color: #000; margin-top: 200px; }
html
<div id="content"> <div id="welcome"> welcome </div> </div>
the margin moving parent div, not inside one. tried give padding parent div, same thing. how solve?
try adding overflow:hidden;
parent
#content{ background:url('../images/bg.jpg') no-repeat left; width:100%; height:811px; overflow:hidden; border: 1px solid; /*remove*/ } #welcome { border: 1px solid; /*remove*/ background:#fff; width:600px; height:50px; color:#000; margin-top:200px; }
here have example:
(i added borders can see it)
Comments
Post a Comment