Loading

浮动和定位脱标的不同(文本文字滞留问题)

<body>
    <div class="top"></div>
    <div class="bottom">文字文字文字文字文字</div>
</body>
1.使用浮动文字会有滞留问题
<style>
        .bottom {
            width: 200px;
            height: 300px;
            background: rgb(212, 23, 23);
        }
        .top {
            width: 200px;
            height: 200px;
            background: rgb(51, 36, 36);
            float: left ; 
        }
    </style>

2.使用定位不会出现文字滞留问题
<style>
        .bottom {
            width: 200px;
            height: 300px;
            background: rgb(212, 23, 23);
        }
        .top {
            width: 200px;
            height: 200px;
            background: rgb(51, 36, 36);
            position: absolute;
        }

posted @ 2018-04-08 16:01  澎湃_L  阅读(133)  评论(0编辑  收藏  举报