How to prevent column break within an element?

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

Consider the following HTML:

  • Number one
  • Number two
  • &
18条回答
  •  悲哀的现实
    2020-11-22 16:18

    The accepted answer is now two years old and things appear to have changed.

    This article explains the use of the column-break-inside property. I can't say how or why this differs from break-inside, because only the latter appears to be documented in the W3 spec. However, the Chrome and Firefox support the following:

    li {
        -webkit-column-break-inside:avoid;
           -moz-column-break-inside:avoid;
                column-break-inside:avoid;
    }
    

提交回复
热议问题