开发者

How to stop word-wrapping in a CSS Dropdown menu.

In my dropdown menu some of the text within the LI's is wrapping to a new line. I want al开发者_Go百科l of them to be 1 line.

I have tried:

ul ul li {width:100%;}

which doesn't work.

The image below shows what I am faced with.

How to stop word-wrapping in a CSS Dropdown menu.


li {
  white-space: nowrap; 
}

This should stop the wrapping of the text within the li


Place this on your dropdowns ("Tech Consulting"):

{
    height: auto;
}

In the case of the issue here, place height: auto; on the dropdowns (ul li ul li).

I am going to guess that your CSS sets a height to the ul li a ("Small Business"). This places the text outside of the defined height.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜