How to prevent column break within an element?

后端 未结 18 2504
刺人心
刺人心 2020-11-22 16:09

Consider the following HTML:

  • Number one
  • Number two
  • &
18条回答
  •  长发绾君心
    2020-11-22 16:41

    As of October 2014, break-inside still seems to be buggy in Firefox and IE 10-11. However, adding overflow: hidden to the element, along with the break-inside: avoid, seems to make it work in Firefox and IE 10-11. I am currently using:

    overflow: hidden; /* Fix for firefox and IE 10-11  */
    -webkit-column-break-inside: avoid; /* Chrome, Safari, Opera */
    page-break-inside: avoid; /* Firefox */
    break-inside: avoid; /* IE 10+ */
    break-inside: avoid-column;
    

提交回复
热议问题