user3835979 user3835979 - 2 years ago 68
HTML Question

change font color to all <li> tags

Basically I want to change the color of all the

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>
<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>
<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>

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.

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download