CSS Rendering inconsistency on ul with Firefox being the odd ball out

前端 未结 6 1432
既然无缘
既然无缘 2021-02-01 18:03

Background

I was creating a secondary navigation menu using embedded unordered lists with anchors and headers. Using a CSS reset sheet all headers and anchors are set

6条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-01 18:55

    Update

    This is actually broken and has been since 2000. Still not fixed. I thought I had figured it out but it was a mistake on my part. STILL BROKEN! :(

    Answer

    Setting the CSS property of "list-style" to "disc" will cause the Firefox and Camino rendering engine, Gecko, to render the headers inside an unordered list "normal".

    Answer Background

    After following @o.k.w's advice of digging into the rendering engine I found that my problem had been reported on bugzilla.mozilla.org on April 22, 2000! (*Cough* Um, Mozilla... the bug is still there.) The reported bug at https://bugzilla.mozilla.org/show_bug.cgi?id=36854 discusses the fact that Mozilla's rendering engine, Gecko, has a problem displaying headers in an unordered list while displaying the list item marker inside. It also says about this problem:

    "This actually seems to be a major CSS1 compliance issue..." - David Baron

    At the bottom of the bug report thread there is a link a w3c.org document that led me to find my fix:

    "There is a description in a CSS 2.0 recommendation: http://www.w3.org/TR/CSS2/generate.html#q11 which tell us that Gecko behavior is faulty." - Listy Blaut

    At the bottom of that document there is a suggestion to set the CSS list-style to disc:

    ul        { list-style: disc }
    

    Setting the unordered list list-style to "disc" has "fixed" the rendering problem in Gecko rendering engine browsers, Firefox & Camino, while leaving the lists unchanged in other browsers. *Note: Although "disc" is a list-style-type property, if "list-style-type: disc" is used instead of "list-style: disc" it does not fix the problem.

    Solution Example Code

    
    
        
    
    
         

    How I feel finding the answer to my own question


    (source: michaelgrace.org)

    I can finally sleep ; )

提交回复
热议问题