List items with same height

后端 未结 8 1270
谎友^
谎友^ 2020-12-18 23:36

I have created a fiddle: http://jsfiddle.net/pQZ8f/

I want to have both the list items to be of same height without setting height manually. I want it to auto grow.

8条回答
  •  轮回少年
    2020-12-19 00:25

    List is set as table and it will contain table properties. for list item when you set table-cell they will get table cell properties and by default all table cells will get same height.

    
    .list {
         display: table;
    
        .list-item {
           display: table-cell;
        }
    }
    
    
    
    
    
    • Heading

      Details in text

    • Heading 2

    • Heading 2

      this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text this is text

提交回复
热议问题