0

My magento store is version 1.9.1 I'm using a modified version of the rwd default theme. By default, in the main top navigation bar your category names appear as text which links to their corresponding pages. I want to change one of my category names from this text to a small image/ .png because I want one of my categories to be a brand and I'd like to show off that logo there. I don't want to change all the category names, just that specific one. What can I do?

  • i can't understand can you please explain with screen shot – Magento 2 Oct 9 '15 at 13:43
  • gyazo.com/4dcfeeadbe037390817b70411a4348ca This is the Category name. Instead of saying the category name I want it to be a small image of my choosing. For instance, I could change it to a star to look like this: gyazo.com/b6f28909652128e3730f884bcaf97ed1 – Tw3nTy Oct 9 '15 at 13:59
  • You want a background image for that vip – Magento 2 Oct 9 '15 at 14:00
  • I'm not entirely sure what you mean by background. I do want to replace the image completely. No more "VIP", just my image. – Tw3nTy Oct 9 '15 at 14:04
0

You can do it with CSS:

a[href$="/vip.html"] {
    background: url("path/to/image.png") no-repeat scroll 0 0;
    text-indent: -9999px;
    width: 100px;
}

A big negative text-indent is one of the many methods to hide text from an element, then you set it to a fixed width and assign a background image

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.