Erma Isabel
Erma Isabel

Reputation: 555

Apply css for anchor tag inside li

I want to apply css to anchor tag which is inside li and li is inside ".whitedrop" class

    <ul class="dropdown whitedrop">
        <li><a>My Profile</a></li>
        <li><a>Settings</a></li>
    </ul>

I tried,

    .whitedrop li a{
        background: red;
    }

But it is not working. What am i doing wrong here?

Please help, Thanks.

Upvotes: 0

Views: 3558

Answers (1)

Mat&#237;as Fidemraizer
Mat&#237;as Fidemraizer

Reputation: 64933

It's already working. Check this JSFiddle.

Maybe there's another style with background: none interfering someway. Try to alter your CSS rule adding !important just for test purposes to confirm this behavior:

   .whitedrop li a{
        background: red !important;
    }

Also, it can be something related to browser cache. Did you try breaking the cache with a CTRL+F5 in your Web browser tab?

Upvotes: 1

Related Questions