Brian Hansen wrote in dk.edb.internet.webdesign.html:
> Prøv at se på
http://users.cybercity.dk/~ida4328/test.html
>
> Hvorfor bliver div'erne mere end 1px i height i Internet
> Explorer?
>
> CSS'en er Prøv at se på
>
http://users.cybercity.dk/~ida4328/test.css
>
> --
> Vil du lære at kode HTML, XHTML, CSS, SSI, ASP eller ASP.NET?
> - Pædagogiske tutorials på dansk
> - Kom godt i gang med koderne
> KLIK HER! =>
http://www.html.dk/tutorials
Minder vist lidt om det her:
This may be a difficult concept, but it serves useful purposes,
so just accept it. At this stage, we have not lost IE. No, it
gets this right up to here. But now lets start making a mess.
With IE, if you apply a width to the empty paragraph (usually
unintentionally while applying it to all paragraphs), it decides
that you want to give it some height too. So it makes it big
enough to contain one line of text. Not only does this one line
of extra height now get added to the space, but the collapsing is
all wrong. So the gap grows to max(10,30) + max(40,20) +
line-height, so 40 pixels becomes more like 90. And before you
try to use the height style to make it smaller, IE will ignore
you. It will still make it one line-height tall, because of its
incorrect overflow:visible; handling.
In response, the web developer applies some negative margins or
relative positioning, without really knowing what they are doing
or why, until the gap returns to normal in IE, about 40 pixels.
(This assumes that IE does not decide to cut off the content
where a negative margin pushes it over the bounds of its original
position.) Of course, this has a very bad effect in the other
browsers, as they correctly apply the 40 pixels, plus the
negative 50 that was applied for IE, meaning the contents of the
two paragraphs now overlap by 10 pixels. Definitely not the
intended effect. This is a bit of an extreme example, but the
effect is the same, even if a normal margin (or the browser's
default margin) is applied to the paragraphs.
Lorte IE!
--
Vil du lære at kode HTML, XHTML, CSS, SSI, ASP eller ASP.NET?
- Pædagogiske tutorials på dansk
- Kom godt i gang med koderne
KLIK HER! =>
http://www.html.dk/tutorials