Welcome to WebmasterWorld Guest from

Forum Moderators: not2easy

Message Too Old, No Replies

Spacing problem in div

Spacing problem in div



6:16 pm on Jun 9, 2004 (gmt 0)

10+ Year Member

I keep getting a space beneath any graphic in a div. I've stripped down my code and this is what I have:

<div class="divright"><img border="0" src="images/icon.jpg" />

The stylesheet contains the following:

.divright {display: block;float: right;
background-color : red; }

Very simple but I keep getting a red color beneath the graphic. I tried adding heights and <br />'s
but nothing seems to work.

Thanks so much


6:28 pm on Jun 9, 2004 (gmt 0)

10+ Year Member

font-size: 0;

in the divright selector


6:35 pm on Jun 9, 2004 (gmt 0)

10+ Year Member

Thank you so much. That worked perfectly.


12:34 pm on Jun 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

Message #3 by tedster in the thread below explains why this is happening:



Featured Threads

Hot Threads This Week

Hot Threads This Month