Blogger Information
Blog 87
fans 0
comment 0
visits 59309
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
第八节课作业:5.同级清除浮动
黄忠倚的博客
Original
594 people have browsed it

实例

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>6.同级元素之间的清除浮动的技巧</title>

	<style type="text/css">
		.text {
			background-color: yellow;
			width: 200px;
			height: 200px;
			float: right;
			clear: both;
		}
		.box1 {
			background-color: blue;
			width: 200px;
			height: 200px;
			float: left;
			clear: both;

		}.box2 {
			background-color: coral;
			width: 200px;
			height: 200px;
			float: right;
			clear: both;

		}.box3 {
			background-color: green;
			width: 200px;
			height: 200px;
			/*float: right;*/
			clear: both;
		}


	</style>

</head>
	<body><!-- 
		浮动与绝对定位
		相同之处:元素都脱离了文档流,任何元素浮动之后都变成了块元素,都支持宽高,span特点:浮动总是沿着碎屏方向 -->
		<span class="text">PHP中文网</span>
		<div class="box1"></div>
		<div class="box2"></div>
		<div class="box3"></div>
</body>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例


Correction status:Uncorrected

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post