Bootstrap implements the default navigation bar effect.
The navigation bar is a good feature and a prominent feature of the Bootstrap website. The navigation bar is a responsive meta component that serves as the navigation title of an application or website. The navigation bar is collapsed in the mobile device view. The navigation bar expands horizontally as the width of the available view increases. At the core of the Bootstrap navigation bar, the navigation bar includes defining the style for the site name and basic navigation.
To create a default navigation bar, follow these steps:
- Add class. navbar,. navbar-default (Black-White), and navbar-inverse to the <nav> label)
- Adding role = "navigation" to the above element helps increase accessibility.
- Add a title class. navbar-header to the <div> element, which contains the <a> element with class navbar-brand. This will make the text look bigger.
To add a link to the navigation bar, simply add an unordered list with class. nav and. navbar-nav.
The following example demonstrates this:
<! DOCTYPE html>
The effect is as follows:
Set
<nav class="navbar navbar-inverse" role="navigation">
Change
<nav class="navbar navbar-default" role="navigation">
The effect is as follows:
The above is the code for Bootstrap to implement the default navigation bar effect. I hope it will be helpful for your learning.
Articles you may be interested in:
- Every day, Bootstrap must learn
- Navigation bar required by Bootstrap every day
- Implement responsive navigation bar using Bootstrap
- Operation methods of each element in the Bootstrap navigation bar (Form, button, text)