【发布时间】:2019-01-31 23:44:41
【问题描述】:
我正在为宽度超过 2560 像素的屏幕创建简单的媒体。我的问题是我有标题并且超过 2600 像素我为我的标题设置了静态宽度,当我调整超过 2600 像素的窗口大小时,标题有 2600 像素的宽度但图像正在调整大小。如何设置相对于标题宽度而不是屏幕宽度的图像大小??
#header {
position: relative;
height: 100vh;
.background-image {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
background-image: url('~/images/17.jpg');
background-size: cover;
background-attachment: fixed;
filter: brightness(50%);
-webkit-filter: brightness(50%);
}
}
@media only screen and (min-width: 2600px) {
#header {
width: 2600px;
margin: 0 auto;
height: 1000px;
.background-image {
width: 2600px;
}
}
}
【问题讨论】:
-
你的意思是像percentage?
-
嗯,不,我想要比例的图像,但要停止缩放
标签: html css media-queries