阅读背景:

如何在css中保持背景图像的宽高比

来源:互联网 

I'm currently working of the mobile version of a website and I want all images to fill 90% of the screen width. I think the best technique to achieve this is creating a div for every image which is using the image as background-image. The problem is that I don't know how to match the height of the div with the aspect ratio of the image. I have tried to set width: 90% and height: auto but it didn't worked.I'm currently working of the mobile version of




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: