Home >
Web Front-end >
JS Tutorial >
Bootstrap introductory book (5) Navigation bar, paging navigation_javascript skills
Bootstrap introductory book (5) Navigation bar, paging navigation_javascript skills
WBOY
Release: 2016-05-16 15:14:55
Original
1424 people have browsed it
Navigation bar
Navigation bar (navbar) and the Bootstrap introductory book - (4) menu, button and navigation introduced in the previous section. Navigation (nav) is only one word different, with an additional word "bar". In fact, they are still obviously different in the Bootstrap framework. There is a background color in the navigation bar (navbar), and the navigation bar can be a pure link (similar to navigation), a form, or a combination of form and navigation. They collapse (and can be opened and closed) on mobile devices and gradually expand horizontally as the viewport width increases.
Basic navigation bar
Actually, the difference in appearance between navigation bar and navigation is not that big, but in actual use, navigation bar is much more complicated than navigation. Let's implement a basic navigation bar.
When making a basic navigation bar, pay attention to the following points:
1. First, add the class name .navbar-nav based on the navigation list (
)
2. Add a container (div) outside the list. If allowed here, it is recommended to use
3. The main function of the navbar class is to set effects such as left and right padding and rounded corners. Use .navbar-default to control the color of the navigation bar, such as .navbar-inverse.
With title, secondary menu
In web page production, you can usually see a title in front of the menu (the text size is slightly larger than other text). In fact, the Bootstrap framework has also taken this into consideration for everyone, through .navbar-header And .navbar-brand to achieve, such as:
Of course it can also be used to make a logo, as described on the Chinese official website, which will not be described in detail here.
Needless to say more about the secondary menu. It has been explained in detail in the previous blog. If you still don’t understand it, you can read my previous blog again. Let’s take a look at the following paragraph. Code and achievable effects: (note that the navbar-inverse navigation bar is used here)
We often see search forms in the navigation bar, such as Zhihu, Sina Weibo, etc. Of course, the Bootstrap framework cannot lack such a thing. The method of use is also very simple:
A .navbar-form is provided in the Bootstrap framework. Place a form with the .navbar-form class name in the .navbar container; then add .navbar-left to make the form float left for better alignment.
In Bootstrap, the .navbar-right style is also provided to align elements to the right of the navigation bar.
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn