Difficulty with webpage css

I’m making a dropdown menu system and have this:

The problem is the links in the dropdowns are always black although they should be orange. I thought maybe the error was that the color #cc5500 in “li a:link” didn’t descend (I don’t know why it wouldn’t) so I added this:

to no effect. However, when I added

I get exactly what I want.

So why won’t the menu links display in orange without the :hover added to the top row li?

Because the second menu is a property of li:hover not just li? If you look at the code for the parent item, the ul, it also is a property of li:hover.

Using color names like ‘black’ or ‘orange’ is better coding practice – it would make your code more understandable. (Though that color is closer to ‘IndianRed’.)

There’s something about #topmenu li ul that seems wrong to me. ul should be before li, even if it’s a hierarchical menu. I think. Maybe.

In any case, this is usually the kind of thing I use !important for.

Here’s a cool and unrelated thing - if you’re using the colour codes that are double characters for each of R, G, and B, such as #cc5500, you can reduce it down to just three and it will still work: #c50

#topmenu must be the ID of a ul, and that CSS is addressing li’s within it that have ul’s within them that have li’s within them.

It’d be weird if it was ul li li like you’re thinking.

Aha, that’s what I was missing. Fair enough.