CSS Margin Top Issues

Posted by Denoteone on Stack Overflow See other posts from Stack Overflow or by Denoteone
Published on 2010-12-24T04:50:59Z Indexed on 2010/12/24 4:54 UTC
Read the original article Hit count: 256

Filed under:
|
|

Not sure why I am having such a hard time with this. Trying to add a 10px top margin to a

that is inside of a div. But that does not add the gutter I want and just pushes the containing div down 10px.

Styles

#item{width:738px; height:168px; background-image:url(../images/item_bg.png);margin:0px auto;}
#description{width:314px; height:55px;}
#description p{font:12px arial; color:#666666;margin:10px 0 0 30px;}

HTML/PHP

echo "<div id='item'>
           <div id='description'><p>{$row['description']}</p></div> 
     </div>";

If I use padding it works fine but I want to know why margin-top isn't working?

© Stack Overflow or respective owner

Related posts about php

Related posts about html