How to prevent column break within an element?

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

Consider the following HTML:

  • Number one
  • Number two
  • &
18条回答
  •  Happy的楠姐
    2020-11-22 16:40

    This answer might only apply to certain circumstances; If you set a height to your elements, this will be obeyed by the column styling. There-by keeping anything that is contained within that height to a row.

    I had a list, like the op, but it contained two elements, items and buttons to act upon those items. I treated it like a table

      - table,
    • - table-row,
      - table-cell put the UL in a 4 column layout. The columns were sometimes being split between the item and it's buttons. The trick I used was to give the Div elements a line height to cover the buttons.

    提交回复
热议问题