如何在图像达到某一点后阻止其收缩

How do I stop an image from shrinking after it has reached a certain point?

本文关键字:一点 图像      更新时间:2023-09-26

我的背景图像有这么大:1920×1200

以下是我如何显示它:

html {
    background: url("back.png") no-repeat top left fixed; 
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
}

这很好,但现在我想让它在达到某个预定义范围后停止重新调整?就像当图像缩小到1300 x 500时,它应该停止。

我怎样才能做到这一点?

您签出了min-widthmax-width属性吗?

当你开始扰乱宽度时,请确保将高度设置为100%以保持纵横比。