how to set css width equal to length of longest text

前端 未结 3 891
时光取名叫无心
时光取名叫无心 2020-12-14 18:18

I have quite a challenging task.

I have this menu here... http://jsfiddle.net/K2Zzh/6/

If you hover over \'treatments\', the width for the dropdown menu is s

3条回答
  •  再見小時候
    2020-12-14 18:59

    Put the width to "li" instead of "a" , and you can use padding too

    .dropdown ul li {
        width: auto;
        padding:5px;
        display:block;
    }​
    

    i think it should works

提交回复
热议问题