0

I'm trying to optimize the following site for mobile devices: http://whitehallrow.com/

The blue ribbon links function by using a CSS hover selector to change the image when hovered over:

.ribbonlinkA{
    background-image:url("/wp-content/uploads/2013/05/hr_slide_off.png");
    display:block;
    height:86px;
    width:512px;
}
.ribbonlinkA:hover{
    background-image:url("/wp-content/uploads/2013/05/hr_slide_on.png");
    display:block;
    height:86px;
    width:512px;
}

I've been using width:100% for the images on the page, which resizes them well on my Blackberry. However, I can't get the ribbon links to resize at all; they simply overflow off the right side of the page, even with width:100%.

How can I get them to resize appropriately?

Hemerson Varela
  • 24,034
  • 16
  • 68
  • 69
Ben
  • 139
  • 6
  • 13

1 Answers1

1

You'd have to use the background-size property (which isn't supported by all browsers) to get CSS backgrounds to scale. You might be better off using <img> elements, toggled with javascript, for larger images (>320px) like you're using.

landons
  • 9,502
  • 3
  • 33
  • 46