我想让背景图像在宽度和高度上都有响应,这样我就可以在移动设备上运行它.
@H_403_2@我用过这个
.your_background_class_name { width: 100%; height:auto; top: 0px; left: 0px; z-index: -1; position: absolute; }@H_403_2@但它只能在宽度上工作.我应该做些什么改变才能使它发挥作用?
解决方法
html { background: url(https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcSvctt0I--skoKQVfuVt-i4Et6vQ5ve7lXPkLy9sTElCWLKh1Ps) no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; }@H_403_2@了解背景大小here的更多信息. @H_403_2@See demo