美文网首页
2019-10-25 div浮动小作业

2019-10-25 div浮动小作业

作者: 任地狱丶 | 来源:发表于2019-10-25 20:08 被阅读0次
使用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

相关文章

  • 2019-10-25 div浮动小作业

    代码如下 结果如下

  • 前端—浮动(float)

    浮动 我们可以这样理解浮动,图中有页面,div1,div2,div3,div4。 div1 div2 div3...

  • CSS基础之清除浮动,Margin塌陷现象详解

    1.浮动的清除 1.1.浮动现象 现在两个div,div身上没有任何属性。每个div中都有li,这些li都是浮动的...

  • BFC-float-position

    浮动定位 BFC 边距合并 浮动元素 div的顺序是HTML代码中div的顺序决定的。 浮动可以理解为让某个div...

  • CSS float 盒子模型 position

    属性: float 浮动 浮动的内容用div包起来,给div设置宽高 clear 清除浮动。 box-sizing...

  • 2019-07-09 定位之float

    demo: 在上图中,几个div的设置如下: div5、div6、div9是浮动元素 我们可以看到,浮动元素后面的...

  • 2019-10-25 div+css浮动案例

    效果如上。要注意其实需要浮动的只有绿色蓝色以及黄色的部分,其他三个div标签是不需要浮动的。解决浮动问题有两种方法...

  • css3复习

    清除浮动: 方法:clear清除浮动(添加空div法)在浮动元素下方添加空div,并给该元素写css样式: ...

  • div 左边定宽,右边自适应

    方法一: div1 设置浮动,div2设置margin-left:第一个div的宽度。代码如下: 方法二 : 浮动...

  • 浮动的DIV水平垂直居中

    方法: 在浮动后的div外面套一层div.warp,设置外层父级div的水平垂直居中就可以让浮动的div也达到水平...

网友评论

      本文标题:2019-10-25 div浮动小作业

      本文链接:https://www.haomeiwen.com/subject/jveevctx.html