SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2004
    Location
    Central Illinois
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Firefox 4 bug with "first-letter" pseudo class

    I've found what I think is a bug with Firefox 4's rendering of CSS of elements that include a background image on a first-letter pseudoclass.

    Here's a sample document that exhibits the bug on every installation of Firefox 4 I have access to:

    HTML Code:
    <html>
    <head>
    <title>Firefox 4 first-letter CSS bug</title>
    <style type="text/css">
    p:first-letter {
    	background: url('/path/to/image.gif') no-repeat top left;
    }
    </style>
    </head>
    <body>
    <p>This is a bit of a problem.</p>
    </body>
    </html>
    The behavior I'm seeing is the page loads totally black, but will show the paragraph once some of the text is selected with the mouse or with CTRL + A. However, the rest of the page remains black.

    On other real-world pages that contain this sort of code, scrolling may help things fill in sporadically over the page but not reliably.

    Switching tabs and coming back to this one appears to correct the problem; the page will be rendered properly after that.

    Particularly strange is the fact that, for me at least, even the browser tab often turns black in the middle where it would ordinarily display the title of the page.

    The background image can be existent or non-existent; simply having the code present triggers the bug.

    Has anyone else noticed this, or can anyone else reproduce it?

  2. #2
    SitePoint Addict EarlyOut's Avatar
    Join Date
    Mar 2011
    Location
    Sector R
    Posts
    280
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No problem in FF4 here at all, with or without an actual background image present. IE9, on the other hand, doesn't display the background image behind the letter unless you give the page a proper DOCTYPE.

  3. #3
    SitePoint Enthusiast
    Join Date
    Aug 2004
    Location
    Central Illinois
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for checking. What OS are you on? I've tested on Vista and XP.

  4. #4
    SitePoint Addict EarlyOut's Avatar
    Join Date
    Mar 2011
    Location
    Sector R
    Posts
    280
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No problem on Win7/64, Win7/32, or WinXP.

  5. #5
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,526
    Mentioned
    182 Post(s)
    Tagged
    6 Thread(s)
    Works for me in FF4.01 xp also.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •