頁面兩側的側邊欄中背景圖像的垂直重複會停止在計算機屏幕結束的位置,而不是頁面結束的位置。正如你所看到的,我已經試圖讓所有的父母height: 100%
在CSS中,但它不起作用。我如何讓圖像重複到頁面底部?如何在兩個側邊欄中垂直重複背景圖片?
HTML:
<body>
<div class="sidebar" id="sidebar1"></div>
<div id="content">
</div>
<div class="sidebar" id="sidebar2"></div>
</body>
CSS:
html, body {
min-height: 100%;
min-width: 100%;
}
#content {
min-height: 100%;
width: 80%;
margin-left: auto;
margin-right: auto;
text-align: center;
}
.sidebar {
min-height: 100%;
left: 0;
position: absolute;
top: 0;
width: 100%;
z-index: -1;
}
#sidebar1 {
background: url(image.png) repeat-y bottom left;
background-size: 125px 125px;
}
#sidebar2 {
background: url(image.png) repeat-y bottom right;
background-size: 125px 125px;
}