<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Document</title>
<style type="text/css">
.a{width: 200px;height: 200px;background: red;float: left;}
.a1{width: 150px;height: 150px;background: yellow;}
.b{width: 300px;height: 300px;background: blue;}
.b1{width: 250px;height: 220px;background: green;}
</style>
</head>
<body>
<div class="a">diva
<div class="a1">diva1</div>
</div>
<div class="b">
divb
<div class="b1">divb1</div>
</div>
div.a浮动之后,提高半个层级(比同级div.b高,但是和div.b内的所有文字是同级的)
</body>
</html>
04_01.float
最新推荐文章于 2022-10-30 16:27:49 发布