Html 我怎样才能使背景和页面一样长?
我正在更改的网站出现问题。页面的背景不像我放在侧面的横幅那样持续,因此网站看起来很糟糕。你能帮我想一想如何延长集装箱的背景,使其与横幅一样长(1500px)吗? 很抱歉,我对这个问题的描述太模糊了,我在这里放了一个问题网站的链接,这样你就可以更好地理解我的意思。 是的 非常感谢,Html 我怎样才能使背景和页面一样长?,html,css,background,background-image,opencart,Html,Css,Background,Background Image,Opencart,我正在更改的网站出现问题。页面的背景不像我放在侧面的横幅那样持续,因此网站看起来很糟糕。你能帮我想一想如何延长集装箱的背景,使其与横幅一样长(1500px)吗? 很抱歉,我对这个问题的描述太模糊了,我在这里放了一个问题网站的链接,这样你就可以更好地理解我的意思。 是的 非常感谢, Iris您可以使用背景大小属性。局限于现代的思想。您也可以只拉伸背景图像。您需要将 <div style="clear:both"></div> 到容器内部div的末尾,将容器拉伸到其内容
Iris您可以使用背景大小属性。局限于现代的思想。您也可以只拉伸背景图像。您需要将
<div style="clear:both"></div>
到容器内部
div的末尾,将容器拉伸到其内容
或者更好地使用看起来您有一个CSS语法错误:
#column_left {
float:left;
width:230px;
clear:; // needs to be "clear:both"
padding:30px 0 0 10px;
}
由于横幅具有固定的高度,您可以将相同的高度属性添加到#容器id中
#container {
width: 990px;
margin-left: auto;
margin-right: auto;
text-align: left;
background: url(../image/layout/bg-container.jpg) center 0 repeat-y;
height: 1504px;
}
多亏了你的回复,我已经设法把背景画得更长了,但是页脚总是没有花在边上,不管我做了多长时间的横幅,我不明白为什么。
#container {
background-image: url("../image/layout/bg-container.jpg");
background-size: 990px 1518px;
}
#footer {
background: url("../image/layout/bg-footer.jpg") no-repeat scroll center top transparent;
bottom: 0;
height: 60px;
margin: -130px 0 0;
padding: 70px 20px 0;
position: relative;
}
#container {
width: 990px;
margin-left: auto;
margin-right: auto;
text-align: left;
background: url(../image/layout/bg-container.jpg) center 0 repeat-y;
height: 1504px;
}