Subramanian K
Subramanian K

Reputation: 65

Bootstrap Dropdown issue ( When we fix the max-width to the button in the dropdown text-overflow issue)

HTML :
<li class="dropdown display-bl">
     <a href="#" class="dropdown-toggle wrapping" data-toggle="dropdown" role="button">CL</a><i class="fa fa-chevron-down"></i>
  <ul class="dropdown-menu login">
   .....

CSS :
.wrapping {
    max-width: 150px;
    text-overflow: clip;
    white-space: nowrap;
    overflow: hidden;
}

here is the code above ! When the text limit crosses the 150 px the text starts to overflow clip as above css given.When the text-overflow happens it automatically hide the Dropdown icon also. But i need the dropdown icon to be visible even when the text overflows. Any help will be appreciated.Thanks.

Upvotes: 2

Views: 335

Answers (1)

G Naga Subrahmanyam
G Naga Subrahmanyam

Reputation: 308

I hope this code will work for you. Try to use the code which is given below.

Happy Coding :-) ;-)

<!DOCTYPE html>
<html>
<head>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
  <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
</head>
<style>
</style>
<body>
<div class="container">
<ul class="list-unstyled">
<li class="dropdown">
    <a class="btn btn-primary dropdown-toggle" role="button" data-toggle="dropdown">CL
    <span class="caret"></span></a> <!--Drop Down List Menu Main title Here-->
    <ul class="dropdown-menu">
      <li><a href="#">Login</a></li> <!--Add Your List Here-->
    </ul>
  </li>
</ul>
</div>
</body>
</html>

Upvotes: 1

Related Questions