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.

<div class="navbar navbar-default" role="navigation"><!--role是为了方便屏幕阅读器理解此处内容-->
 <ul class="nav navbar-nav">
 <li class="active"><a href="#">HTML</a></li>
 <li><a href="#">CSS</a></li>
 <li><a href="#">JavaScript</a></li>
 <li><a href="#">PHP</a></li>
 </ul>
</div>
Copy after login

The effect that can be achieved is as follows:

Widescreen:


Narrow screen:


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 (

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template