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.
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.
精彩评论