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

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

    Well, I've had same problem, but circle was not an option - I needed the decimal notation. After few minutes of research, I've found a perfect solution with

    ol { counter-reset: li; } ol li h4:before { content: counter(li) ". "; counter-increment: li; } On the element I want to append the list-style item (In my case it was ol>li>div>h3! It can be positioned relative/absolute also). Effect is great, number of item is perfectly concatenated with H3 content.

    I really suggest you to try this. Here is full tutorial: http://www.456bereastreet.com/archive/201105/styling_ordered_list_numbers/

提交回复
热议问题