Home >Web Front-end >HTML Tutorial >ios移动端部分手机不支持background-attachment: fixed 的解决办法_html/css_WEB-ITnose

ios移动端部分手机不支持background-attachment: fixed 的解决办法_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:27:431677browse

ios系统和某些移动端background-attachment:fixed不兼容性,没有任何效果,但可以hack一下就可以了,代码如下:

ps:想在哪个标签加背景,可以在它class后:before.

body:before {  content: ' ';  position: fixed;  z-index: -1;  top: 0;  right: 0;  bottom: 0;  left: 0;  background: url(path/to/image) center 0 no-repeat;  background-size: cover;}

内容来自:前端录»ios_iphone_移动端background-attachment:fixed兼容性[失效]

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn