Reputation: 333
I have a dropdown menu that contains the List of products of our company.I have an product names Hotel Management Solutions
which i am trying to show in single line of dropdown menu but is coming in multiple lines.
Here Is the Fiddle..
Here is the HTML code..
<nav>
<ul style="padding-left: 3px">
<li><a href="#">Products</a>
<ul>
<li><a href="#">Hotel Management Solutions </a>
</li>
</ul>
</li>
</ul>
</nav>
Please help me to display the content in One line only..
Upvotes: 0
Views: 64
Reputation: 7447
Add white-space:nowrap
to nav ul ul
:
nav ul ul {
background: #5f6975;
border-radius: 0px;
padding: 0;
position: absolute;
top: 100%;
white-space:nowrap;
}
This will keep each list item on a single line without needing to set a fixed width.
Upvotes: 3
Reputation: 765
Replace your nav ul ul li a property declaration with this
nav ul ul li a {
padding: 1px;
color: #fff;
width: 200px;
}
Upvotes: 0
Reputation: 108
the only solution to this problem is to change the width of products div in the css
nav ul li a {
display: block;
padding: 25px 20px;
color: #00a1e4;
text-decoration: none;
width:250px;
Upvotes: 0
Reputation: 3691
You need to add this style
ul > li > ul li{
display: inline-block;
float: left;
padding: 5px;
}
Upvotes: 0