Welcome to WebmasterWorld Guest from 54.162.214.65

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)

New User

10+ Year Member

joined:June 9, 2004
posts:3
votes: 0



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" />
</div>

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 June 9, 2004 (gmt 0)

Preferred Member

10+ Year Member

joined:Sept 24, 2002
posts:364
votes: 0


font-size: 0;

in the divright selector

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

New User

10+ Year Member

joined:June 9, 2004
posts:3
votes: 0


Thank you so much. That worked perfectly.
12:34 pm on June 10, 2004 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Nov 13, 2002
posts:818
votes: 0


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

[webmasterworld.com...]