I've set a top margin of 5em to a Div element that holds a background image. This Div element is within an other Div element. The top margin of 5em is being assigned to both Div elements, but I only want it to be assigned to the Div element that holds a background image. How can I fix this problem?
Code CSS:body { padding:0px; margin:0px; } div#wrapper { margin:0 auto; width:70em; } div#main { background-color:SteelBlue; width:70em; height:70em; } div#image { width:201px; height:201px; background:url(../_images/image.png); margin:5em auto 0em auto; }
Thanks in advanceHTML Code:<body> <div id="wrapper"> <div id="main"> <div id="image"></div> </div> </div> </body>![]()







Bookmarks