0

I'm currently using a span, that I'm filling with a background to make sure that the images are exactly the same size in all browsers. While I have no complaints about this, I'm missing the opportunity to use the alt tag and the potential SEO advantage that it might carry.

Is there a way to do crop an image using html+css only (no js) using the img tag?

Daniel
  • 34,125
  • 17
  • 102
  • 150
  • why can't you use the `.img-responsive` class? see also: http://stackoverflow.com/questions/17932509/images-not-responsive-by-default-in-twitter-bootstrap-3/17933207#17933207 – Bass Jobsen Oct 06 '13 at 21:57
  • the problem is that it fits the image as best as it can without stretching it, so images with different aspect ration show up differently. using background setting for a div sets allows the overflow to be cropped – Daniel Oct 06 '13 at 23:12

1 Answers1

0

If the SEO for the image is very important perhaps you can include the image with relevant alt, but with style="display: none". Crawlers may be smart enough to rule this out though..!

webbo
  • 339
  • 2
  • 6