Reputation: 1727
For dropdown menu , if I fix the size of menu heading and use text-overflow: ellipsis; this also takes off caret symbol . You can see it here and below is the code
<div class="navbar navbar-inner">
<ul class="nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">This is my test heading <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="editProfile"> Edit Profile </a></li>
<li><a href="logout/"><i class="icon-block"></i> Logout</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Second <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="editProfile"> Edit Profile </a></li>
<li><a href="logout/"><i class="icon-block"></i> Logout</a></li>
</ul>
</li>
</ul>
</div>
Is there any way ( hack) I can get caret here ?
Thank You
Upvotes: 2
Views: 2005
Reputation: 595
Here is a solution that wraps the text in its own div.
http://jsfiddle.net/alforno/XSpZv/1/
.ael {
width:100px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden !important;
float:left;
}
And the html changed to this:
<li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">
<div class="ael">This is my test heading</div> <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li><a href="editProfile"> Edit Profile </a></li>
<li><a href="logout/"><i class="icon-block"></i> Logout</a></li>
</ul>
</li>
Upvotes: 3
Reputation: 3435
Add the caret before the text, and float it right.
<b class="caret pull-right">This is my test heading
Upvotes: 3