麻烦老师检查

来源:2-5 编程练习

localhost999

2020-06-30 13:40:42

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>float</title>
    <style>
        .div1{
            width: 100px;
            height: 100px;
            background: red;
            float:left;
        }
        .div2{
            width: 300px;
            height: 300px;
            background: blue;
            float:right;
        }
        .div3{
            width: 100px;
            height: 100px;
            background: green;
           /*此处写代码*/
           float:inherit;  /*该属性继承继承伟为使得DIV3继承父元素的浮动属性*/
        }
    </style>
</head>
<body>
    <div class="div1"></div>
    <div class="div2">
        <div class="div3"></div>
    </div>
</body>
</html>


写回答

1回答

好帮手慕码

2020-06-30

同学你好,代码是正确的。继续加油,祝学习愉快!

0

0 学习 · 40143 问题

查看课程