2019-10-25 div浮动小作业

使用div 浮动完成下列表格
image.png

代码如下

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <style>
            .class1{
                width: 500px;
                height: 100px;
                background-color: #0000FF;
                
            }
            .class2{
                width: 300px;
                height: 100px;
                background-color: #000000;
                float: left;
            }
            .class3{
                width: 200px;
                height: 100px;
                background-color: #008000;
                float: left;
            }
            .class4{
                width: 500px;
                height: 100px;
                background-color: yellow;
                /*float: left;*/
            }
            .class5{
                width: 150px;
                height: 100px;
                background-color: #8A2BE2;
                float: left;
            }
            .class6{
                width: 150px;
                height: 100px;
                background-color: aqua;
                float: left;
            }
            .class7{
                width: 150px;
                height: 100px;
                background-color: red;
                float: left;
            }
            .class8{
                width: 150px;
                height: 100px;
                background-color: darkgoldenrod;
                float: left;
            }
            .class9{
                width: 200px;
                height: 200px;
                background-color: firebrick;
                float: left;
            }
            .class10{
                width: 500px;
                height: 100px;
                background-color: gold;
                /*float: left;*/
            }
            .vol1{
                width: 500px;
                height: 100px;
            }
            .vol2{
                width: 300;
                height: 100;
            }
            .clear{
                clear: both;
            }
            .vol3{
                width: 300;
                height: 200;
                float: left;
            }
            .vol4{
                width: 500px;
                height: 200px;
            }
        </style>
    </head>
    <body>
        <div class="class1">qwe</div>
        <div class="vol1">
        <div class="class2">qwe</div>
        <div class="class3">asd</div>   
        </div>
        <div class="class4">4</div>
        <div class="vol4">
        <div class="vol3">
        <div class="vol2">
            <div class="class5">z5c</div>
            <div class="class6">z6c</div>
        </div>
    
        <div class="vol2">
            <div class="class7">777777777</div>
            <div class="class8">888</div>
        </div>
        </div>
        <div class="class9">&nbsp;&nbsp;&nbsp;999</div>
        <!--<div class="clear"></div>-->
        </div>
        <div class="class10">10c</div>
    </body>
</html>

结果如下


image.png
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容