如何让背景和页面一样长?
我在更改网站时遇到了问题。页面的背景不像我放在两侧的横幅那样继续,因此该网站看起来很糟糕。你能帮我弄清楚如何将容器的背景延长到与横幅一样长(1500px)吗? 很抱歉我对问题的描述如此模糊,我在此处放置了问题网站的链接,以便您可以更好地理解我的意思。 它是 http://gentlecare.ro/index.php?route=information /information&information_id=6
非常感谢, 鸢尾花
I've encountered a problem with a website I'm changing. The background of the page does not continue like the banners I've put on the sides and the site looks horrible because of this. Could you please help me figure out how to prolong the background of the container as long as the banners( 1500px)?
I'm sorry my description of the problem is so vague, I am putting a link here to the website with the problem so you can better see what I mean.
It is http://gentlecare.ro/index.php?route=information/information&information_id=6
Thanks a lot,
Iris
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您可以使用背景大小属性。限于现代浏览器思想。您也可以仅拉伸背景图像。
You can use background-size property. Limited to modern browsers thought. You can also just strech the background image.
您需要放在
container-inner
div 的末尾以将容器拉伸到其内容或者更好地使用 CSS Clearfix 最佳跨浏览器解决方案
You need to put
to the end of your
container-inner
div to stretch the container to it's contentOr better use CSS Clearfix Best Cross browser solution
您似乎有 CSS 语法错误:
it seems like you have a CSS syntax error:
由于横幅具有固定的高度,因此您可以将相同的高度属性添加到 #container id 中。
Since the banners have a fixed height, you could add the same height attribute to your #container id.
还有这个
and this