日期:2014-05-16  浏览次数:20701 次

div里东西怎么显示到外面去了【简化版】
上个问题我自己描述的太罗嗦了,重开一个= =


<html>
   <head>
      <title>hehe</title>
      <style type="text/css">
     div#a
 {
 background-color:#F00;
 width:50%;
 height:500px;
 }
 
         div#c
         {
            background-color:#000;
            width:30%;
            height:40%;
         }
 
         div#b
         { 
    background-color:#0C0;
            width:30%;
            height:60%;
         }
 
 div#d
 {
float:right;
background-color:#60C;
margin-left:30%;
width:70%;
            height:100%;
 }
      </style>
   </head>
   <body>
      <div id="a">
         <div id="d"></div>
         <div id="b">hehe</div>
         <div id="c"></div>
      </div>
   </body>
</html>


b里面的东西居然显示到了外面,而且关键是我的d是float到右边的,居然会把b里的东西撑到最下面,不是太理解是什么情况。



------解决方案--------------------
b元素左浮动就好