第一个div浮动:左第二个div溢出:隐藏和margin-top:3000px无效

时间:2017-11-21 07:12:26

标签: css-float overflow

第一个div浮动:左第二个div溢出:隐藏和margin-top:3000px无效。

div2 设置margin-top:3000px没有margin-top!?



<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title></title>
    <style media="screen">

      body{
        margin:0;padding:0;
      }

      .box{
        width:300px;
        height:300px;
        margin-top:20px;
        background:blue;
      }

      .sub{
        width:100px;
        height:100px;
        margin-top:30px;
        margin-bottom:20px;
        background-color: yellow;


      }

      .fl {
        float:left;
        margin-right: 100%;
      }

      .clear{
        clear:both;
      }

      .absolute{
        position:absolute;
      }

      .inline-block{
        display: inline-block;
      }

    </style>
  </head>
  <body>
    test
    <div class="box" style="margin-left:20px;">
       <div class=" box sub fl" style="">ccc</div>
       <div
       class="box sub"
       style="
       overflow:hidden;
       background:red;
       margin-top:3000px;">
       div2
       </div>
       <div class="box sub" style="overflow:hidden;">

       </div>
    </div>

  </body>
</html>
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:0)

div2 margin-top被float:left div?

吃掉
相关问题