Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selecting an element inside Div for CSS decoration

Tags:

css

element

I am looking to give black color to each "a" element inside of the listing class. How can I select the "a" element from the listing class in CSS to achieve this?

    <ul class="listing">
       <li><a href="#">Jobs</a></li>
       <li><a href="#">Advertising</a></li>
       <li><a href="#">Brands</li>
       <li><a href="#">Small Businesses</a></li>  
       <li><a href="#">FAQ</a></li>
       <li><a href="#">Privacy Policy</a></li>  
    </ul>
like image 470
Payam Avatar asked Feb 29 '12 18:02

Payam


1 Answers

.listing a { color: #000; }

Though, if you've defined using pseudo classes elsewhere, you may need:

.listing a:link, .listing a:visited { color: #000; }

like image 51
Scott Brown Avatar answered Oct 12 '22 23:10

Scott Brown