Norman Posted June 12, 2008 Share Posted June 12, 2008 Hello guys and gals, I have this CSS code: .dcontent {border: 1px solid #0099FF;padding: 15px;margin-top: 25px;margin-right: 25px;margin-left: 295px;} And this HTML: <div class="dcontent"><div style="float: right"><img src="imgs/money_image.gif" /></div>Test</div> And I get this:http://img213.imageshack.us/img213/8152/blablans5.jpgWhy? Can you please help me? Link to comment Share on other sites More sharing options...
Ingolme Posted June 12, 2008 Share Posted June 12, 2008 Use this HTML: <div class="dcontent"><div style="float: right"><img src="imgs/money_image.gif" /></div>Test<div style="clear: both"></div></div> Link to comment Share on other sites More sharing options...
rzea Posted June 14, 2008 Share Posted June 14, 2008 Ingolme's suggestion is correct.The idea of using a DIV to clear the floats (<div style="clear: both"></div>) is to kind of 'cancel' them. I remember I used a table as a wrapper on a website once before I knew about this, the website was already up and running so I didn't change it... but I learned Now, a tip to optimize your CSS: .dcontent {border: 1px solid #0099FF;padding: 15px;margin: 25px 25px 0 295px; /*top - right - bottom - left*/} Hope this helps. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.