【发布时间】:2013-11-01 05:57:53
【问题描述】:
background: #344b68 url(../../data/img/template/background.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
您好 Stackoverflow,我有以下问题。
Background.jpg 是我的网站背景图片,分辨率为1080p (1920x1080)。在图像的边框上,它淡化为#344b68。
在720p 监视器上查看此内容会导致图片使用background-size: cover 缩小,但在以1440p 分辨率查看此内容时也会增大。
现在我想做的是当它是720p 监视器时,用background-size: cover 缩小图像的尺寸以适应,但是当它高于1080p 时,它保持相同的尺寸,只是淡入静态背景颜色 (#344b68)。
我怎么能做到这一点,最好没有 JS?
提前致谢!
【问题讨论】:
标签: image css background-image