W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2008

[whatwg] Bad CSS on the multipage version

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Wed, 4 Jun 2008 10:31:14 -0500
Message-ID: <dd0fbad0806040831p3022bcbdqe28b1c46a683f96f@mail.gmail.com>
On Wed, Jun 4, 2008 at 8:43 AM, Philip Taylor
<excors+whatwg at gmail.com<excors%2Bwhatwg at gmail.com>>
wrote:

> On 04/06/2008, K?i?tof ?elechovski <giecrilj at stegny.2a.pl> wrote:
> > Regarding your page at the URL
> >  <
> http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level.html
> >  #the-embed>:
> >  [...]
> >  Element headings (level 4) are invisible
> >  (obscured underneath the following content).
>
> Seems to be an IE CSS bug like in
>
> http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0D%0A%3Cstyle%3E%0D%0A%20.a%20%7B%20border%3A2px%20blue%20solid%20%7D%0D%0A%20.b%20%7B%20border%3A2px%20green%20solid%3B%20background%3Ayellow%3B%20margin-top%3A-0.8em%20%7D%0D%0A%3C%2Fstyle%3E%0D%0A%3Cdiv%20class%3Da%3EThis%20text%20should%20be%20visible%20on%20top%20of%20the%20yellow%0D%0A%20%3Cdiv%20class%3Db%3E...%3C%2Fdiv%3E%0D%0A%3C%2Fdiv%3E<http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E%0D%0A%3Cstyle%3E%0D%0A%20.a%20%7B%20border%3A2px%20blue%20solid%20%7D%0D%0A%20.b%20%7B%20border%3A2px%20green%20solid%3B%20background%3Ayellow%3B%20margin-top%3A-0.8em%20%7D%0D%0A%3C%2Fstyle%3E%0D%0A%3Cdiv%20class%3Da%3EThis%20text%20should%20be%20visible%20on%20top%20of%20the%20yellow%0D%0A%20%3Cdiv%20class%3Db%3E...%3C%2Fdiv%3E%0D%0A%3C%2Fdiv%3E>
>
> That case fails in IE7; it works in IE8 (and in recent versions of
> Firefox, Opera, Safari, Konqueror).
>
> I don't know if there's a 'proper' way to fix this, but adding
>   h4 { position: relative; }
> into the page's CSS makes it work correctly in IE7, and doesn't affect
> any other browser.
>
> --
> Philip Taylor
> excors at gmail.com
>

If that fixes it, then it's almost certainly a hasLayout issue (that is, an
IE7 bug).  Position:relative is a hasLayout trigger in IE7.  Generally
speaking, an element's behavior when it has layout is the correct behavior
(or at least *more* correct).

~TJ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20080604/ae1cc72c/attachment.htm>
Received on Wednesday, 4 June 2008 08:31:14 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:03 UTC