Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change navbar border color in Bootstrap 4

In Bootstrap 3 we can change navbar color by setting .navbar-light border-color. However, it doesn't working by setting .navbar-light border-color in Bootstrap 4.

like image 922
Mr.Joe Avatar asked Nov 26 '17 20:11

Mr.Joe


People also ask

How can I change navbar background color in bootstrap 4?

The Navbar is transparent by default. If you only want to change the background color, it can be done simply by applying the color to the <navbar class="bg-custom"> , but remember that won't change the other colors such as the links, hover and dropdown menu colors.

How do I change the color of my navbar links?

bg-color classes to add a background color to the navbar. Tip: Add a white text color to all links in the navbar with the . navbar-dark class, or use the . navbar-light class to add a black text color.

How do I put a border on my navigation bar?

Add text-align:center to <li> or <a> to center the links. Add the border property to <ul> add a border around the navbar. If you also want borders inside the navbar, add a border-bottom to all <li> elements, except for the last one: Home.


1 Answers

Since the OP wanted just the border on the bottom.

<nav class="navbar border-bottom border-dark">
   ...
</nav>

if you'd like to change the colors or anything else with the borders refer to @klooven's answer.

Here is the link too.

like image 59
domshyra Avatar answered Sep 21 '22 08:09

domshyra