【问题标题】:Element doesn't break properly firefox元素无法正确破坏 Firefox
【发布时间】:2020-03-22 21:04:58
【问题描述】:

我有这个 css 代码:

.parent {
  column-count: 2;
}
p, h2, h3, h4, h5, h6 {
  page-break-inside:avoid;
  break-inside:avoid;
}

和html:

<div class="parent">
 <p>lorem ipsum and so on</p>
</div>

Chrome v80(一切都很好):

火狐v74:

These tricks 不工作。 在firefox doc 中它说它应该可以工作。但事实并非如此。我究竟做错了什么? Striped codepen

【问题讨论】:

    标签: css firefox page-break-inside


    【解决方案1】:

    至少添加margin:0;到p

    p{margin:0}
    

    【讨论】:

    • 什么都不做
    • 你说得对,firefox好像有bug,你不能用flex吗?
    猜你喜欢
    • 1970-01-01
    • 2014-02-08
    • 2020-11-10
    • 2015-02-14
    • 2023-03-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-06-25
    相关资源
    最近更新 更多