How can I positioning LI elements to the bottom of UL list

后端 未结 3 830
粉色の甜心
粉色の甜心 2021-01-17 15:16

I have menu items like: Row1 Row2.. RowN and I want them not to be that wide - that\'s why including breaks (with max-width)

I have this HTML:



        
3条回答
  •  猫巷女王i
    2021-01-17 15:55

    Use display: inline-block instead of float:

    ul.menu
    {                 
       vertical-align: bottom;
    }
    
    ul.menu li
    {    
       display: inline-block;
       text-align: center;
    }
    

    EDIT: Added text-align: center;. If I understand your comment correctly, that is what you want. If not, you'll need to be more specific.

提交回复
热议问题