Paul Mason
Paul Mason

Reputation: 1818

Style first level of menu only

To style the first level of a menu i would think this code would work:

http://jsfiddle.net/2g36L/1/

Could someone please point out where I'm going wrong, thanks.

Upvotes: 0

Views: 1882

Answers (2)

Mike Brant
Mike Brant

Reputation: 71384

Color is an inherited CSS trait, so even though you are declaring it only for the immediate UL beneath the div, it is being inherited by the nested elements.

Upvotes: 1

j08691
j08691

Reputation: 207861

It does, but since you've given no other color to the other elements they inherit the color you gave the top <ul> element. If you give the other <ul> a color, it works fine.

jsFiddle example.

Upvotes: 3

Related Questions