Steven10172
Steven10172

Reputation: 2013

Child Div interrupts Parent Div repeat-y background

I currently have a div element with a repeat-y background and a child div interrupts the current background.

How can I stop this from happening?

      <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: #content { float:left; margin: 5px auto; border: red 1px solid; }

#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;
}

If you go to EXAMPLE you can

Upvotes: 1

Views: 369

Answers (1)

Hardik
Hardik

Reputation: 536

you need to make your container overflow hidden cause you are floating childs.

checkout code at http://jsfiddle.net/xUf87/

Upvotes: 2

Related Questions