简体   繁体   中英

bootstrap 3 - crop image to fit width & height

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?

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..!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM