编程练习。
来源:4-7 编程练习
sx1011
2020-09-01 22:46:38
<!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回答
同学代码完成的很好,继续加油呐~
祝学习愉快
相似问题