html - Child Div打断Parent Div repeat-y背景

标签 html css

我目前有一个带有 repeat-y 背景的 div 元素和一个子 div 中断了当前背景。

我怎样才能阻止这种情况发生?

      <div id="content">
     <div id="container-top"></div>
     <div id="container-body">
        <div id="container-right">
           <h1>LOGIN</h1>
           <br />
           <h1>CLICK HERE</h1>
        </div>
        <div id="container-left">
           <h1 style="padding-left: 50px; font-weight: bold; color: #000000;">NEWS</h1>
        </div>
     </div>
     <div id="container-bottom"></div>
  </div>

CSS: #内容 { 向左飘浮; 边距:5px 自动; 边框:红色 1px 实心;

#container-top {
   width: 800px;
   height: 23px;
   background: url(http://cdn2.tribalwars.net/graphic/index/sprites.png) no-repeat 0 -39px;
}

#container-body {
   padding: 15px;
   overflow: visible;
   background: url(http://cdn2.tribalwars.net/graphic/index/bg-content-line.jpg) repeat-y;
}

#container-right {
   float: right;
   width: 275px;
}

#container-left {
   float: left;
   width: 440px;
}

#container-bottom {
   width: 800px;
   height: 23px;
   background: url(http://cdn2.tribalwars.net/graphic/index/sprites.png) no-repeat 0 -56px;
   clear: both;
}

如果你去 EXAMPLE你可以

最佳答案

你需要让你的容器溢出隐藏起来,因为你是漂浮的 child 。

结帐代码在 http://jsfiddle.net/xUf87/

关于html - Child Div打断Parent Div repeat-y背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11427651/

相关文章:

jquery - 如何更改已经在客户端的网页的字体?

jquery - 涟漪效应继续越过圆 Angular (尤其是圆形按钮)

css - 与 css 中的宽度有些混淆

css - Blogspot 简单模板,居中背景

Javascript:条件函数onClick按钮

javascript - 是否有 jQuery 修复程序可以使 CSS3 在所有浏览器中工作?

javascript - 为什么此 CSS 代码会在桌面 View 中 chop 内容?

html - 更改 HTML 密码字段中显示的符号

jquery - 如何只为背景指定类名?

PHP "Session_regenerate_id"和用户身份验证