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

前端 未结 6 1500
既然无缘
既然无缘 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:38

    Because a heading is a block element and therefore gets pushed to the next line (since a block-level element displaying as block (or without an otherwise specified display-type [inline-block, inline, etc...] gets) can't share a line; I don't know if a list-element should (or shouldn't), according to spec, contain block level elements inside itself, or if it should be presumed to be 'sharing' the line with the contained element.

    I could be wrong, about all of this, though; it's just the only explanation I could think of.

    You may, also, find that there are default margins, padding or positioning being applied to the heading elements in Firefox. You could test with Firebug (or alternatives) to see where the positioning is coming from.


    edit

    After copy-pasting your code into my template file, and viewing in FF3.0.10 I don't see the problem you report. The resulting code I used is pasted below, if you haven't already resolved this, try the code, below, and see if the problem persists:

    
    
        
    
    
    
        
    
    
    
    
    
    
    

提交回复
热议问题