css - 显示 : list-item not working properly in Firefox?

标签 css firefox rendering listitem

我很确定它在某个地方有记录,但我的谷歌搜索和查看 mdn 并没有给我任何实质性的信息。

考虑以下示例:

<doctype html>
<html>

  <head>
    <title>Array test</title>
  </head>

  <body>
    <style scoped>
      div {
        margin: 20px;
        padding: 20px;
        display: list-item;
        list-style-type: decimal;
      }
    </style>

    <div>one</div>
    <div>two</div>
    <div>three</div>
    <div>four</div>
  </body>

</html>

如果你在 Chrome 或 safari 中渲染它,或者任何我能拿到的 webkit 浏览器,div 将被编号为 1、2、3、4。但在 Firefox 中,所有元素都将为 0。

有解决办法吗?在纯 CSS 中?

TIA

最佳答案

如果您想使用纯 CSS 解决方案,您可以显式使用 CSS 计数器,对吧?

关于css - 显示 : list-item not working properly in Firefox?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9336776/

相关文章:

html - 如何让 phpbb3 占据整个页面?

javascript - jQuery 单击事件在移动版 Firefox 中不起作用

javascript - 如何使用 jQuery 或 javascript 保留 cookie 而不更改浏览器设置?

python - Pygame block 传输错误

javascript - 当从 javascript 调用字符串时,Latex 不渲染?

html - 我如何在 css 中水平居中 div 元素?

html - 在页面中心显示文本字段

c# - 渲染嵌套评论

html - 如何在 CSS 蒙版内添加阴影?

python - Firefox 自定义配置文件不起作用 [Python]