Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap navbar no border radius?

I'm trying to remove the border and round corner from the nav-bar.

.navbar-default {
    -webkit-border-radius: 0;
    -moz-border-radius: 0;
    border-radius: 0;
}

But it does not work, any ideas?

HTML,

    <nav class="navbar navbar-default" role="navigation">
        <div class="container-fluid">
            <div class="navbar-header">
                <a class="navbar-brand" href="#">Brand</a>
            </div>
            <ul class="nav navbar-nav">
                <li><a href="#">Home</a></li>
                <li><a href="#">Work</a></li>
                <li><a href="#">Shop</a></li>
                <li><a href="#">About</a></li>
            </ul>
        </div>
    </nav>
like image 878
Run Avatar asked Feb 17 '16 08:02

Run


3 Answers

Try adding .navbar-static-top in your nav class

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha256-7s5uDGW3AHqw6xtJmNNtr+OBRJUlgkNJEo78P4b0yRw= sha512-nNo+yCHEyn0smMxSswnf/OnX6/KwJuZTlNZBjauKhTK0c+zT+q5JOCx0UFhXQ6rJR9jg6Es8gPuD2uZcYDLqSw==" crossorigin="anonymous"> 
<nav class="navbar navbar-default navbar-static-top" role="navigation">
        <div class="container-fluid">
            <div class="navbar-header">
                <a class="navbar-brand" href="#">Brand</a>
            </div>
            <ul class="nav navbar-nav">
                <li><a href="#">Home</a></li>
                <li><a href="#">Work</a></li>
                <li><a href="#">Shop</a></li>
                <li><a href="#">About</a></li>
            </ul>
        </div>
    </nav>
like image 82
metacrescent Avatar answered Nov 04 '22 06:11

metacrescent


".navbar-default" is not cause. To remove the border and round corner from the nav-bar, You should try it:

.navbar {
    -webkit-border-radius: 0;
    -moz-border-radius: 0;
    border-radius: 0;
}
like image 38
Huy Nguyen Avatar answered Nov 04 '22 08:11

Huy Nguyen


This is usually when ur css is loaded before bootstrap css and is getting overwritten. Make sure ur css is defined after bootstrap.

Your code is fine. Have a look at this JSFiddle.

https://jsfiddle.net/0h8muuc3/2/

.navbar-default{
  border: none;
  border-radius: 0;
}

<nav class="navbar navbar-default" role="navigation">
        <div class="container-fluid">
            <div class="navbar-header">
                <a class="navbar-brand" href="#">Brand</a>
            </div>
            <ul class="nav navbar-nav">
                <li><a href="#">Home</a></li>
                <li><a href="#">Work</a></li>
                <li><a href="#">Shop</a></li>
                <li><a href="#">About</a></li>
            </ul>
        </div>
    </nav>
like image 3
arunwithasmile Avatar answered Nov 04 '22 07:11

arunwithasmile