Dividing long list of
  • tags into columns?
  • 后端 未结 3 2047
    闹比i
    闹比i 2020-12-05 19:23

    I\'ve got a list of about 30

  • in a
      . Is there any way, using CSS, to divide these into three columns of ten?

  • 3条回答
    •  春和景丽
      2020-12-05 20:03

      In CSS3 this is possible.

      #columns {
        -moz-column-count: 3;
        -moz-column-gap: 20px;
        -webkit-column-count: 3;
        -webkit-column-gap: 20px;
        column-count: 3;
        column-gap: 20px;
      }
      

      HTML:

        ... lots of lis ...

      The list items will spill over into the next column as they exceed the height of the container.

      Perhaps for older browser you could use JavaScript, as this seems to be more aesthetic than a critical feature.

    提交回复
    热议问题