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?

4
  • i can't understand can you please explain with screen shot
    – Magento 2
    Commented Oct 9, 2015 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
    Commented Oct 9, 2015 at 13:59
  • You want a background image for that vip
    – Magento 2
    Commented Oct 9, 2015 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
    Commented Oct 9, 2015 at 14:04

1 Answer 1

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 and acknowledge you have read our privacy policy.

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