Ricardo Ribeiro
Ricardo Ribeiro

Reputation: 87

CSS menu image in WordPress

I´m coding a CSS menu for Wordpress and I have this stupid problem:

I give the first ul a background image and that same image shows also on every sub menus, which I don´t want.

How can I tell the first ul that the background image is only for that ul? And not for the following sub menus.

Upvotes: 0

Views: 159

Answers (2)

anuj_io
anuj_io

Reputation: 2173

You need to change the selector for ul where you want the image to appear. You CSS code should look something like

.nav > ul {
background: url("........
}

Assuming nav is the class attached to immediate parent of desired ul.

Upvotes: 1

sascha
sascha

Reputation: 4690

Two ways

Set the background of your sub-menus to the background-color your site has.

or

Show us your code, because I think you used something like

ul { background: url(...) } 

which applies for all <ul>-elements, even your sub lists.

Upvotes: 0

Related Questions