List items with same height

后端 未结 8 1287
谎友^
谎友^ 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:31

    You can use: display: inline-table on your LI elements

    li {
        width:100px;
        background: red;
        display: inline-table
    }
    

    here is JSFiddle

提交回复
热议问题