手记

float对于后面元素的影响

<!DOCTYPE html>
<html>
<head>
    <title></title>
    <style type="text/css">
    *{
        padding: 0;
        margin: 0;
    }
.s1{

    width: 100px;
    height: 100px;
    border: 1px solid black;
    float: left;
}
.s2{
    width: 100px;
    height: 100px;
    background-color: yellow;
    border: 1px solid red;

}

}

    </style>
</head>
<body>
<div class="s1">盒子1</div>
<div class="s2">盒子2</div>

</body>
</html>
0人推荐
随时随地看视频
慕课网APP