Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What replaces nav lists in Bootstrap 3?

I am preparing to update my site to Bootstrap 3, but I can’t figure out how to replace the nav-list class from Bootstrap 2.

I looked into list groups, but I am not sure if this is to be used to replace nav lists. How would I make the below markup work in Bootstrap 3?

<div class="well">     <ul class="nav nav-list">         <li><a href="#">Link 1</a></li>         <li><a href="#">Link 2</a></li>     </ul> </div> 

EDIT

This is the look I am going for: http://jsfiddle.net/bplumb/2Nguy/

like image 408
Blake Plumb Avatar asked Aug 16 '13 20:08

Blake Plumb


People also ask

What is nav item in Bootstrap?

Navigation available in Bootstrap share general markup and styles, from the base . nav class to the active and disabled states. Swap modifier classes to switch between each style. The base . nav component is built with flexbox and provide a strong foundation for building all types of navigation components.

How do I set bootstrap active class to NAV menu?

To set the active class to the navigation menu dynamically by scrolling or clicking on the navigation links, the active class is to be set on each section depending on the position of the webpage. To add methods and variables, JavaScript is used.

How will you create a tabbed pills and vertical pills navigation menu in bootstrap?

To make the tabs toggleable, add the data-toggle="tab" attribute to each link. Then add a . tab-pane class with a unique ID for every tab and wrap them inside a <div> element with class . tab-content .


2 Answers

EDIT

The removal of .nav-list has been documented in Migrating to v3.x – What’s removed:

Nav lists
.nav-list .nav-header
No direct equivalent, but list groups and .panel-groups are similar.


I found this change listed in the changelog inside the “WIP: Bootstrap 3” pull request:

  • Remove .nav-list option. Replaced by the new .list-group component.

So if I translate your code to use .list-group instead, I get this:

<div class="well">     <ul class="list-group">         <li class="list-group-item"><a href="#">Link 1</a></li>         <li class="list-group-item"><a href="#">Link 2</a></li>     </ul> </div> 

<link href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0-rc2/css/bootstrap.min.css" rel="stylesheet"/>    <div class="well">      <ul class="list-group">          <li class="list-group-item"><a href="#">Link 1</a></li>          <li class="list-group-item"><a href="#">Link 2</a></li>      </ul>  </div>

However, this does not look identical to the way it did in Bootstrap 2. As I noted in this answer’s comments, there seems to be no exact .nav-list equivalent built-in to Bootstrap 3. So if you need features that .list-group doesn’t have, you will have to write the CSS yourself, or try to port it from Bootstrap 2.

like image 141
Rory O'Kane Avatar answered Sep 22 '22 18:09

Rory O'Kane


I used class="nav nav-pills nav-stacked" and for me it's a better styled replacement. But perhaps it is resolved in version 3.0.2.

like image 23
gungott Avatar answered Sep 21 '22 18:09

gungott