Bootstrap navigation bar Each element action method (form, button, text) _javascript skill

Source: Internet
Author: User
Tags button type

This article mainly includes three major aspects, everybody studies carefully.

1, the form in the navigation bar
the form in the navigation bar is not the default class as described in the Bootstrap form chapter, which uses the. Navbar-form class. This ensures that the form is properly vertically folded over the alignment in the narrower viewport. Use the alignment options, which will be explained in detail in the Component Alignment section, to decide where to place the contents of the navigation bar.

The following example demonstrates this:

<! DOCTYPE html>  

Effect:

Black effect

2, the button in the navigation bar
you can use class. Navbar-btn to add buttons to <button> elements that are not in <form>, and the buttons are centered vertically on the navigation bar ... navbar-btn can be used in <a> and <inpu On the t> element.

Do not use. NAVBAR-BTN on <a> elements within. Navbar-nav, because it is not a standard button class.
The following example demonstrates this:

<! DOCTYPE html>  

The effect is as follows:

3, the text in the navigation bar
If you need to include a text string in the Navigator, use class. Navbar-text. This is commonly used with <p> tags to ensure proper leading and color. The following example demonstrates this:

<div class= "Navbar-header" > 
 <a class= "Navbar-brand" href= "#" > Lin Bingwen in this ~</a> 
 </div> 
 <div> 
 <p class= "navbar-text" > Navigation bar text </p> 
 </div> 
 <div> 

The effect is as follows:

If you want to further study, you can click here to learn, and then attach two wonderful topics: Bootstrap Learning Tutorials Bootstrap Practical course

The above is the entire content of this article, I hope to help you learn, we can more skillfully realize the bootstrap navigation bar.

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.