简体   繁体   English

调整图像大小以适合于大于图像宽度的浏览器窗口

[英]resize image to fit browser window bigger than image width

i'm looking to resize my images in my image slider automatically to fit the browser window while keeping my image size as low as possible. 我想在图像滑块中自动调整图像大小以适合浏览器窗口,同时保持图像尺寸尽可能小。 The images itself have a fixed width of 800px but when the browser window scales to more than that the images don't scale along. 图片本身具有800px的固定宽度,但是当浏览器窗口缩放到超出图片不能缩放的范围时。 They stay a fixed 800px. 他们保持固定的800px。 Is there a way to resolve that. 有没有办法解决这个问题。

You can see an example at: http://www.continuous-ltd.be/ctb-site/indextest.html 您可以在以下位置查看示例: http : //www.continuous-ltd.be/ctb-site/indextest.html

thx 谢谢

You could use background-size: 100%; 您可以使用background-size: 100%; but keep in mind that it's not implemented on all browsers yet 但请记住,尚未在所有浏览器中实现

只需使用:

max-width:100%

you can also use this css 您也可以使用此CSS

.slides, .slides li, .slides li img{
    max-width:100%;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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