【发布时间】:2014-04-28 16:08:03
【问题描述】:
我想让背景图像在宽度和高度上都具有响应性,以便我可以在移动设备上运行它。
我用过这个
.your_background_class_name {
width: 100%;
height:auto;
top: 0px;
left: 0px;
z-index: -1;
position: absolute;
}
但它只适用于宽度而不适用于高度。我应该做些什么改变才能让它发挥作用?
【问题讨论】:
-
您必须使用
background-size属性。检查此链接css-tricks.com/perfect-full-page-background-image
标签: css responsive-design background-image