Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

change font color to all <li> tags

Tags:

html

css

Basically I want to change the color of all the li tags to white from the code shown below

<nav class="navbar navbar-inverse">
  <div class="container-fluid">
    <div class="navbar-header">
      <a class="navbar-brand" href="#">WebSiteName</a>
    </div>
    <ul class="nav navbar-nav navbar-right">    
      <li><a href="#">Home</a></li>
      <li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown"   href="#">Page 1 <span class="caret"></span></a>
          <ul class="dropdown-menu">
              <li><a href="#">Page 1-1</a></li>
              <li><a href="#">Page 1-2</a></li>
             <li><a href="#">Page 1-3</a></li>
          </ul>
      </li>
      <li><a href="#">Page 2</a></li>
      <li><a href="#"><span class="glyphicon glyphicon-user"></span> Sign Up</a></li>
      <li><a href="#"><span class="glyphicon glyphicon-log-in"></span> Login</a></li>
</ul>
</div>
</nav>

I tried to add a CSS for the li tags

nav.navbar nav.navbar-inverse div.container-fluid ul.nav ul.navbar-nav   
ul.navbar-right li a {
color: white;
}

but it not changing the color to white. Please help.

like image 936
user2211678 Avatar asked Apr 21 '16 13:04

user2211678


1 Answers

if u write li{color:white} then u just change the list point icon not text because there are anchors in them so u should write li a{color:white} to make all li text white

like image 143
mr. pc_coder Avatar answered Sep 20 '22 18:09

mr. pc_coder