HTML List element : Sharing the parent width into equal parts

后端 未结 5 1893
無奈伤痛
無奈伤痛 2020-12-01 06:39

I have a parent

    and couple of
  1. items in that.

      &
5条回答
  •  死守一世寂寞
    2020-12-01 07:24

    As Renesis pointed out, I think table cells is the only option, unless you're scripting it. Although you can use table-cell in CSS.

    #menu {display: table-row;}
    #menu li {display: table-cell;}
    

    ..which will simulate the behaviour. Note that in IE it will, as usual, cause problems in the lower versions.

提交回复
热议问题