css - Creating a responsive menu in Bootstrap -


i trying create dropdown menu using bootstrap, not able make responsive. menu :

enter image description here

but when resize window, not resizing & width stays constant.

enter image description here

here code :

<!doctype html> <html> <head>     <title>bootstrap test</title>      <!-- latest compiled , minified css -->     <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">      <!-- optional theme -->     <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css">      <!-- latest compiled , minified javascript -->     <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>     <script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>     <style type="text/css">     p{         text-align: center;     }     img {         max-width:100%;     }     .dropdown-menu{         width: 50em;     }     </style>  </head> <body>      <div class="btn-group">         <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">             action <span class="caret"></span>         </button>         <div class="dropdown-menu" role="menu">                 <div  class="panel panel-default">                     <div class="panel-heading">my menu</div>                     <div class="panel-body">                         <div class="row">                             <div class="col-xs-2"><img src="http://placeimg.com/128/128/tech"><p>stuff</p></div>                             <div class="col-xs-2"><img src="http://placeimg.com/128/128/tech"><p>stuff</p></div>                             <div class="col-xs-2"><img src="http://placeimg.com/128/128/tech"><p>stuff</p></div>                             <div class="col-xs-2"><img src="http://placeimg.com/128/128/tech"><p>stuff</p></div>                             <div class="col-xs-2"><img src="http://placeimg.com/128/128/tech"><p>stuff</p></div>                             <div class="col-xs-2"><img src="http://placeimg.com/128/128/tech"><p>stuff</p></div>                         </div>                         <div class="row">                             <div class="col-xs-2"><img src="http://placeimg.com/128/128/tech"><p>stuff</p></div>                             <div class="col-xs-2"><img src="http://placeimg.com/128/128/tech"><p>stuff</p></div>                             <div class="col-xs-2"><img src="http://placeimg.com/128/128/tech"><p>stuff</p></div>                             <div class="col-xs-2"><img src="http://placeimg.com/128/128/tech"><p>stuff</p></div>                             <div class="col-xs-2"><img src="http://placeimg.com/128/128/tech"><p>stuff</p></div>                             <div class="col-xs-2"><img src="http://placeimg.com/128/128/tech"><p>stuff</p></div>                         </div>                     </div>                 </div>         </div>     </div> </body> </html> 

another solution use regular button expands panel.

<button type="button" class="btn btn-default" data-toggle="collapse" data-target="#my-menu">action <span class="caret"></span></button> <div id="my-menu" class="panel panel-default collapse">     <div class="panel-heading">my menu</div>     <div class="panel-body">     <div class="row">         <div class="col-xs-2"><img src="http://placeimg.com/128/128/tech" class="img-responsive"><p>stuff</p></div>         <div class="col-xs-2"><img src="http://placeimg.com/128/128/tech" class="img-responsive"><p>stuff</p></div>         <div class="col-xs-2"><img src="http://placeimg.com/128/128/tech" class="img-responsive"><p>stuff</p></div>         <div class="col-xs-2"><img src="http://placeimg.com/128/128/tech" class="img-responsive"><p>stuff</p></div>         <div class="col-xs-2"><img src="http://placeimg.com/128/128/tech" class="img-responsive"><p>stuff</p></div>         <div class="col-xs-2"><img src="http://placeimg.com/128/128/tech" class="img-responsive"><p>stuff</p></div>     </div>     <div class="row">         <div class="col-xs-2"><img src="http://placeimg.com/128/128/tech" class="img-responsive"><p>stuff</p></div>         <div class="col-xs-2"><img src="http://placeimg.com/128/128/tech" class="img-responsive"><p>stuff</p></div>         <div class="col-xs-2"><img src="http://placeimg.com/128/128/tech" class="img-responsive"><p>stuff</p></div>         <div class="col-xs-2"><img src="http://placeimg.com/128/128/tech" class="img-responsive"><p>stuff</p></div>         <div class="col-xs-2"><img src="http://placeimg.com/128/128/tech" class="img-responsive"><p>stuff</p></div>         <div class="col-xs-2"><img src="http://placeimg.com/128/128/tech" class="img-responsive"><p>stuff</p></div>     </div>     </div> </div> 

you can check fiddle.

i've used responsive images well.