"Bootstrap Navbar Cart Dropdown"
Bootstrap 3.3.0 Snippet by rgbskills

<nav class="navbar navbar-default navbar-fixed-top"> <div class="container-fluid"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#">You Shop Name</a> </div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav"> <li class="active"><a href="#">Category one <span class="sr-only">(current)</span></a></li> <li><a href="#">Category two</a></li> </ul> <ul class="nav navbar-nav navbar-right"> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> <span class="glyphicon glyphicon-shopping-cart"></span> 7 - Items<span class="caret"></span></a> <ul class="dropdown-menu dropdown-cart" role="menu"> <li> <span class="item"> <span class="item-left"> <img src="http://lorempixel.com/50/50/" alt="" /> <span class="item-info"> <span>Item name</span> <span>23$</span> </span> </span> <span class="item-right"> <button class="btn btn-xs btn-danger pull-right">x</button> </span> </span> </li> <li> <span class="item"> <span class="item-left"> <img src="http://lorempixel.com/50/50/" alt="" /> <span class="item-info"> <span>Item name</span> <span>23$</span> </span> </span> <span class="item-right"> <button class="btn btn-xs btn-danger pull-right">x</button> </span> </span> </li> <li> <span class="item"> <span class="item-left"> <img src="http://lorempixel.com/50/50/" alt="" /> <span class="item-info"> <span>Item name</span> <span>23$</span> </span> </span> <span class="item-right"> <button class="btn btn-xs btn-danger pull-right">x</button> </span> </span> </li> <li> <span class="item"> <span class="item-left"> <img src="http://lorempixel.com/50/50/" alt="" /> <span class="item-info"> <span>Item name</span> <span>23$</span> </span> </span> <span class="item-right"> <button class="btn btn-xs btn-danger pull-right">x</button> </span> </span> </li> <li class="divider"></li> <li><a class="text-center" href="">View Cart</a></li> </ul> </li> </ul> </div><!-- /.navbar-collapse --> </div><!-- /.container-fluid --> </nav>
ul.dropdown-cart{ min-width:250px; } ul.dropdown-cart li .item{ display:block; padding:3px 10px; margin: 3px 0; } ul.dropdown-cart li .item:hover{ background-color:#f3f3f3; } ul.dropdown-cart li .item:after{ visibility: hidden; display: block; font-size: 0; content: " "; clear: both; height: 0; } ul.dropdown-cart li .item-left{ float:left; } ul.dropdown-cart li .item-left img, ul.dropdown-cart li .item-left span.item-info{ float:left; } ul.dropdown-cart li .item-left span.item-info{ margin-left:10px; } ul.dropdown-cart li .item-left span.item-info span{ display:block; } ul.dropdown-cart li .item-right{ float:right; } ul.dropdown-cart li .item-right button{ margin-top:14px; }

Similar snippets: See More


Comments:

comments powered by Disqus