div insert in div

Posted by lolalola on Stack Overflow See other posts from Stack Overflow or by lolalola
Published on 2010-04-12T16:50:56Z Indexed on 2010/04/12 16:52 UTC
Read the original article Hit count: 510

Filed under:
|

Hi, what's wrong with this code? Now disappear background and div after this code show incorrect.

But why when i delete "float: left", everything looks good.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
            "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<style type="text/css">
#first{
 width: 200px;
 background-color: #345752;
}
#left_b{
 background:transparent url('img/left.png');
 background-position: left top;
 background-repeat: repeat-y;
  min-height: 30px;
}
#right_b{
 background:transparent url('img/right.png');
 background-position: right top;
 background-repeat: repeat-y;
}
#text{
 float: left;
 width: 50px;
 height: 30px;
}
#text2{
 float: left;
 width: 70px;
 height: 30px;
}
</style>
</head>
<body>
<div id = "first">
    <div id = "left_b">
 <div id = "right_b"> 
         <div id = "text">
   text 1
  </div>
         <div id = "text2">
             text 2
         </div>
 </div>
   </div>
</div>
</body>
</html>

© Stack Overflow or respective owner

Related posts about css

Related posts about div