【发布时间】:2014-10-04 15:28:30
【问题描述】:
页面两侧边栏中背景图像的垂直重复在计算机屏幕结束处停止,而不是在页面结束处停止。如您所见,我已经尝试在 CSS 中使所有父母 height: 100% ,但它不起作用。如何让图片重复到页面底部?
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;
}
【问题讨论】:
标签: html css background repeat