Bootstrap navigation Element

Source: Internet
Author: User

Bootstrap navigation Element

 

Use ul and li Unordered Lists for table navigation or tags, and add class. nav and. nav-tabs to ul.

 


 

 <Script type = "text/javascript" src = "bootstrap-3.3.4-dist/jquery-2.1.4.min.js"> </script> <script type = "text/javascript" src = "bootstrap-3.3.4-dist/js/bootstrap. min. js "> </script>  
  • Article Management
  • Category Management
  • Comment management
  • Blog Configuration
  • Blog

 

 

When you click a navigation bar, add class to its li. active. nav-tabs> li. active> ,. nav-tabs> li. active> a: focus ,. nav-tabs> li. active> a: hover {color: #555; cursor: default; background-color: # fff; border: 1px solid # ddd; border-bottom-color: transparent ;} capsule navigation menu

 

 

Basic capsule navigation menu

 

To change the label to the capsule style, you only need to use class. Nav-pillsReplace. Nav-tabsYou can.


 

 
  • Article Management
  • Category Management
  • Comment management
  • Blog Configuration
  • Blog

 

 

. Nav-pills> li {
Float: left;
}
. Nav-pills> li. active> a,. nav-pills> li. active> a: focus,. nav-pills> li. active> a: hover {
Color: # FFF;
Background-color: #337AB7 ;}

 

 

Vertical capsule navigation menu when using class . Nav,. nav-pillsAnd use the class . Nav-stackedTo Stack capsules vertically.

 

 

 

 
  • Article Management
  • Category Management
  • Comment management
  • Blog Configuration
  • Blog

 

 

The reason why. nav-stacked can make the capsule vertical:
. Nav-stacked> li {
Float: none;
}

 

 

When the screen width is greater than 768px Or. nav,. nav-pills at the same time use class. nav-justified, let the label or Capsule

 

The same width as the parent element. On a smaller screen, navigation links are stacked.

 

 
  • Article Management
  • Category Management
  • Comment management
  • Blog Configuration
  • Blog

Add the background color to. container for better effect.

 

 

Small screen:

 

You can disable the link li to add. active to display the current status of this menu. You can also add. disabled to it to make it unavailable and disable the link.

 

Of: hover status.

 

 

 
  • Article Management
  • Category Management
  • Comment management
  • Blog Configuration
    • Configuration 1
    • Configuration 2
    • Configuration 3
    •  
    • Configuration 4
  • Blog

This class only changes its appearance and does not change its functions. Here, you need to use custom JavaScript to disable the link, although the appearance here does not appear

 

But you can click it to find that the page will still jump to the Baidu homepage.

 

 

Add an unordered list with. dropdown-menu class from the drop-down menu

 

 

 
  • Article Management
  • Category Management
  • Comment management
  • Blog Configuration
    • Configuration 1
    • Configuration 2
    • Configuration 3
    •  
    • Configuration 4
  • Blog


 


 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.