浮动与clear测试

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>浮动</title>
    </head>
    <body>
        <div style="width: 200px; height: 200px; background-color: red; float: left;"></div>
        <div style="width: 200px; height: 200px; background-color: blue; float: left;"></div>
        <div style="width: 200px; height: 200px; background-color: yellow; float: left;"></div>
        <div style="clear: left; width: 500px; height: 500px; background-color: black;"></div>
        <div style="width: 200px; height: 200px; background-color: gold; float: left;"></div>
        <div style="width: 200px; height: 200px; background-color: green; float: left;"></div>
    </body>
</html>

猜你喜欢

转载自www.cnblogs.com/yxfyg/p/12636215.html