04_01.float

<!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>

發佈了42 篇原創文章 · 獲贊 0 · 訪問量 1萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章