Forum Moderators: not2easy

Message Too Old, No Replies

Space after div in IE

         

andrewsmd

12:04 am on Nov 24, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Maybe it's something simple but I have extra space after a div in IE and I cannot figure out why. Here is the general idea. I have a box that I split into three parts. I have a top, a bottom, and a middle that repeats for content. The problem is, IE is putting space a gap at the bottom of the top div before the middle div shows. Here is the html and css
.bubbleTop{
background-image: url('images/buttons/boxTop.png');
width: 315px;
height: 13px;
margin-left: auto;
margin-right: auto;
background-repeat: no-repeat;
}
.bubbleMiddle{
background-image: url('images/buttons/boxMiddle.png');
background-repeat: repeat-y;
width: 315px;
margin-left: auto;
margin-right: auto;

}
.bubbleContent{

background-repeat: repeat-y;
text-align: left;
width: 285px;
margin-left: auto;
margin-right: auto;
padding-left: 10px;
padding-right: 10px;
padding-top: 0;
padding-bottom: 0;
margin-top: 0;

}

<div id="asdf" class="bubbleMiddle">
<div id="Div1" class="bubbleContent">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh
euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad
minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip
ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate
velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero
eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit
augue duis dolore te feugait nulla facilisi. Nam liber tempor cum .</div>
</div>
<div id="Div2" class="bubbleBottom">
</div>
.bubbleBottom{
background-image: url('images/buttons/boxBottom.png');
width: 315px;
height: 13px;
margin-left: auto;
margin-right: auto;
background-repeat: no-repeat;
}

andrewsmd

12:29 am on Nov 24, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Update, if I change that top image to be bigger than 20px, then the div is fine. IE won't seem to let it go any smaller than 20 px, I put a border on to find that out. Does anyone know why?

TheKiller

4:55 am on Nov 24, 2010 (gmt 0)

10+ Year Member



i cant remember why but i think IE Browsers dont like the spaces after the :

Wrong:
width: 315px;

Right:
width:315px;

SuzyUK

9:12 am on Nov 24, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



@TheKiller I don't think that's a sweeping "bug", I think it does or did apply to some properties, and more obscure ones at that, but andrew can let us know if it cures this..

@andrewsmd - think this is possibly to do with IE and it's default font-size/line-height.. try setting the font-size on the top and bottom divs to be something wee like 1px