Home  >  Article  >  Web Front-end  >  How to change navigation bar color in bootstrap

How to change navigation bar color in bootstrap

coldplay.xixi
coldplay.xixiOriginal
2021-01-20 15:04:2411663browse

How to change the color of the navigation bar in bootstrap: 1. Change the navigation background color, set it to black, and set the background color of the nav tag to black; 2. Change the color of the navigation selected column, change the class name active to newactive, and Set its background color to red.

How to change navigation bar color in bootstrap

The operating environment of this article: Windows 7 system, bootstrapv4.4.1 version, Dell G3 computer.

How to change the color of the navigation bar with bootstrap:

1. The navigation bar HTML page made by bootstrap must be loaded bootstrap.min.css,bootstrap.min.js can achieve the navigation effect. The picture below is the complete code and renderings.

How to change navigation bar color in bootstrap

#2. Change the navigation background color and set it to black. Set the background color of the nav tag to black, and the code is background:#000. Below is the code and renderings.

How to change navigation bar color in bootstrap

#3. Change the color of the navigation selected column, for example, set the background of "Home Page" to red. Change the class name active to newactive and set its background color to red.

How to change navigation bar color in bootstrap

#4. Change the color of the secondary column under "Menu" when the mouse is placed on it. Set the hover attribute of the a tag under the class name dropdown-menu, and set the color to black.

How to change navigation bar color in bootstrap

#5. Change the color of the secondary column when clicking "Menu". The CSS code is .navbar-default .navbar-nav>.open>a:focus {color: black;background-color: red;}, which sets the color of the focus attribute of the a tag below this class.

How to change navigation bar color in bootstrap

#6. Change the color of the default text in the navigation bar. Set the text color of the a tag under the class name navbar-default to white, and the code is .navbar-default .navbar-nav>li>a {color: #fff;}.

How to change navigation bar color in bootstrap

Recommended: bootstrap video tutorial

The above is the detailed content of How to change navigation bar color in bootstrap. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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
Previous article:Is bootstrap responsive?Next article:Is bootstrap responsive?