Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > DIV height - IE6 workaround?

Reply
Thread Tools

DIV height - IE6 workaround?

 
 
Jim Royal
Guest
Posts: n/a
 
      03-06-2005
In article <d0da69$b4o$05$(E-Mail Removed)-online.com>, Jens Lenge
<(E-Mail Removed)> wrote:

> It only works here if I set the font size to a small value.


I have noted the same problem, and the same solution: Internet Explorer
has a problem with DIVs that are smaller than the body font size, even
if the DIV is empty.

For example, on this site: <http://www.ccmustang.com/>

The red topbar above the photo is a DIV with a tiled background. The
DIV is empty otherwise, and there's no whitespace. IE will force it to
be 20 pixels high (rather than the 10 pixels I wanted) unless I reduce
the font size.

As far as I can tell, this is the only workaround.

--
Jim Royal
"Understanding is a three-edged sword"
http://JimRoyal.com
 
Reply With Quote
 
 
 
 
kchayka
Guest
Posts: n/a
 
      03-08-2005
Jim Royal wrote:
>
> For example, on this site: <http://www.ccmustang.com/>
>
> The red topbar above the photo is a DIV with a tiled background. The
> DIV is empty otherwise, and there's no whitespace. IE will force it to
> be 20 pixels high (rather than the 10 pixels I wanted) unless I reduce
> the font size.


The extra space is probably caused by line-height, along with IE's
broken overflow behavior which automatically expands an element to fit
the content, regardless of any specified dimensions.

Set overflow:hidden

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
 
Reply With Quote
 
 
 
 
Jim Royal
Guest
Posts: n/a
 
      03-08-2005
In article <(E-Mail Removed)>, kchayka <(E-Mail Removed)>
wrote:

> > For example, on this site: <http://www.ccmustang.com/>
> >
> > The red topbar above the photo is a DIV with a tiled background. The
> > DIV is empty otherwise, and there's no whitespace. IE will force it to
> > be 20 pixels high (rather than the 10 pixels I wanted) unless I reduce
> > the font size.

>
> The extra space is probably caused by line-height, along with IE's
> broken overflow behavior which automatically expands an element to fit
> the content, regardless of any specified dimensions.
>
> Set overflow:hidden



Whadda you know -- it works.

Any real difference between setting the font size versus setting
overflow? or is it just six of one / half-dozen of the other?

--
Jim Royal
"Understanding is a three-edged sword"
http://JimRoyal.com
 
Reply With Quote
 
Jens Lenge
Guest
Posts: n/a
 
      03-08-2005
> Time to provide an url.

I already did some postings above.
 
Reply With Quote
 
Spartanicus
Guest
Posts: n/a
 
      03-08-2005
"Jens Lenge" <(E-Mail Removed)> wrote:

>> Time to provide an url.

>
>I already did some postings above.


No you posted code requiring us to copy it, open an editor, paste it,
save it, open a browser and open the document. All that trouble to help
you solve a problem, and even then there are several unknown variables
that remain such as server content type and the risk of differences
between the actual code and the copy.

kchayka posted a work around, note that the cure may cause more problems
than it solves.

--
Spartanicus
 
Reply With Quote
 
Jens Lenge
Guest
Posts: n/a
 
      03-08-2005
Spartanicus <(E-Mail Removed)> wrote:

> No you posted code requiring us to copy it, open an editor, paste it,
> save it, open a browser and open the document.


I did that in the first place, yes.
But as Lauri asked for an URL in the first response, I supplied one:

--Cite from my posting above--
>> Sounds strange. URL?

>The small example code from my posting shows it.
>You can see the page at http://www.photoss.de/test/test.htm

--Cite end--

So, as said, I *did* supply an URL a few postings above.
Sorry I you didn't find it. Maybe I should have referred to it in the first
place.

Cheers, Jens

 
Reply With Quote
 
kchayka
Guest
Posts: n/a
 
      03-08-2005
Jim Royal wrote:
> In article <(E-Mail Removed)>, kchayka <(E-Mail Removed)>
> wrote:
>>
>> Set overflow:hidden

>
> Any real difference between setting the font size versus setting
> overflow? or is it just six of one / half-dozen of the other?


font-size is unreliable, since users may have author-defined font sizes
turned off, or set a minimum font-size that would override it.

You do need to be careful with the overflow property, though. MacIE's
overflow handling is quite buggy, for example. Safari has an overflow
bug or two as well.

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Div Height = Image height. help muggslab HTML 1 02-01-2010 07:41 PM
IE6 vs. DIV height 100% emerson.marini HTML 0 07-03-2009 01:09 PM
Can't get DIV height in IE6 to set appropriately (IE7 works fine) Richard.Gohs@pa-tech.com HTML 1 09-24-2008 08:14 AM
child div blocks parent div, height problem... HJ HTML 5 09-01-2006 04:37 PM
How to tell height of div where height is not set? Don Vaillancourt Javascript 8 01-31-2005 11:32 AM



Advertisments