防止变换后的div中的图像失真 [英] Prevent image distortion in transformed div

查看:79
本文介绍了防止变换后的div中的图像失真的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我正在寻找一种在背景上调整变换的方法。

我必须使用< img>标记而不是

Hello, I am looking for a way to adjust the transform on the background.
I had to use a <img> tag instead of a background image on a

上的背景图像以实现所需的效果。任何人都可以推荐一个可以使< img>居中的解决方案当它达到100%宽度时保持比例?通常我会使用带有包含属性的背景图像来实现这种效果,但是因为我必须使用< img>标签为了使这个效果起作用,我无法做到这一点。

请帮帮我。谢谢
to achieve the desired effect. Can anyone recommend a solution that could center the <img> while maintaining the proportions when it goes 100% width? Usually I would use a background image with a contain property to achieve this effect, but since I've had to use a <img> tag in order to get this effect working, I'm unable to do that.
Please help me. Thanks

推荐答案

这篇关于防止变换后的div中的图像失真的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆