0

Why isn't the CSS property applying to <nav>? Can we not do our own styling on these tags of bootstrap? If we can, how?

nav{
  display: none;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
          integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
          
<nav class="navbar bg-dark nav-light shadow">
  <h1 style="color:white">hello</h1>
</nav>
Mr Lister
  • 45,515
  • 15
  • 108
  • 150
Talha Munir
  • 498
  • 1
  • 4
  • 16

1 Answers1

2

As pointed out by @kukkuz CSS uses specifity to apply styling. So simply editing the selector will do the trick

nav.navbar {
  display: none;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
          integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
          
<nav class="navbar bg-dark nav-light shadow">
  <h1 style="color:white">hello</h1>
</nav>
SuperDJ
  • 7,488
  • 11
  • 40
  • 74