Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 212
  • Last Modified:

Give each menu item a different background image

Hi experts

I am using:

.menu a {Background-image: url('Images/HomeD.gif')}

to give my menu items a background image, but how can i give each menu item a different background image?
  • 2
1 Solution
Give each of the items an id like id="item1" , id="item2" etc and then use the ids in the css instead of a class:

#itme1 {background-image: url('Images/HomeD.gif')}
#item2 {background-image: url('Images/HomeE.gif')}
/* etc */
dizzycatAuthor Commented:
I cannot give the items an id, there is no option for that in the item-properties, I am using ASP.Net 4, when I use this though:

.menu a:hover {Background-image: url('Images/HomeL.gif')}

this works fine, strangely though I cannot seem to set the background image of each item.
I don't use ASP.net, but I find it hard to believe that it so lame that it does not allow you to add something as basic and necessary as an id.

If you are that handcuffed, generate to a file and change the code manually by adding the ids and a stylesheet that sets the properties you need.

However I find it hard to believe that ASP does not let you add an id.  Strange... Very strange.

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now