【发布时间】:2018-12-22 02:21:09
【问题描述】:
我希望我的背景图片在移动视图中具有响应性。
我用它来将我的背景图片缩放到整个桌面:
html {
background:url("image/2.jpg") no-repeat center center fixed;
background-size: cover;
}
但我不能得到很好的结果:(这是我搜索中最需要的建议)
@media only screen and (max-width: 600px) {
html{
width: 100%;
}
}
【问题讨论】:
-
请向我们提供更多代码和具体问题的上下文。
-
如何将
width属性附加到我的图像?它只是通过css嵌入 -
@Barrosy 我希望我桌面上的图片在我的移动视图中完美缩放
-
你能张贴一张你想要的照片吗?如果不裁剪
cover或缩小宽度以适应contain,您无法使横向照片填充纵向视图...除非您使其不成比例。