我有这个代码:
body{
margin: 0px;
padding: 0px;
background-image: url(images/header.png), url(images/footer.png);
background-repeat: repeat-x, repeat;
background-height: 50px , 400px; /* ?? */
background-position: 0% 0%, 0% 100%;
}
我可以给 footer.png 一个高度,该高度会在那个特定高度重复吗?
最佳答案
你可以试试background-size
:
body{
margin: 0px;
padding: 0px;
background-image: url(images/header.png), url(images/footer.png);
background-repeat: repeat-x, repeat-x;
background-size: auto, auto 500px; // here give to background images height
background-position: 0% 0%, 0% 100%;
}
关于 background-size
的更多信息 is here .
关于css - body 上有 2 个背景 : how to set the height for the backgrounds,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13525382/