0
我想創建一個全屏div元素,它位於頁腳元素的頂部。全屏div元素(#wrapper
)應該有一個全屏背景圖像,它應該可滾動以顯示放置在背景中的頁腳。全屏滾動包裝不兼容瀏覽器
的jsfiddle:https://jsfiddle.net/tvuqzd17/
html,
body {
height: 100%;
margin: 0;
padding: 0;
}
#wrapper {
\t width: 100%;
\t min-height: 100%;
\t z-index: 0;
\t margin-bottom: 300px;
\t overflow-x: auto;
\t background: url(https://wallpaperscraft.com/image/nature_waterfall_summer_lake_trees_90400_3840x2160.jpg) no-repeat center center fixed;
\t -webkit-background-size: cover;
\t -moz-background-size: cover;
\t \t -o-background-size: cover;
\t \t \t background-size: cover;
\t -webkit-box-shadow: 3px 3px 10px 0px rgba(0,0,0,0.3);
\t -moz-box-shadow: 3px 3px 10px 0px rgba(0,0,0,0.3);
box-shadow: 3px 3px 10px 0px rgba(0,0,0,0.3);
}
footer {
\t position: fixed;
\t bottom: 0;
\t z-index: -10;
\t width: 100%;
\t height: 300px;
\t background: #555;
}
<div id="wrapper"></div>
\t <footer></footer>
但這裏有兩個問題:
- 它工作在鉻,但不是在Safari
- 背景圖片如果s不移動慢慢地;它不應該像現在這樣修復。