欢迎来到DIVCSS5查找CSS资料与学习DIV CSS布局技术!

DIV CSS布局对象靠左、靠右一般采用float浮动属性实现,这里简介下浮动靠左(结构居左)属性名目float:left。

float:left先容:
float为浮动属性,值为left
left为左边意义
float:left即设置对象浮动靠左。

float:left一般CSS结构网页时候非往往用的属性,网页机关时有的构造靠左有的靠右。

float:left靠左简单DIV CSS结构实例代码

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>float:left实例</title>
<style>
.box{ margin:0 auto;height:200px;width:400px;border:1px solid #F00;padding:10px}
.left{float:left; border:2px solid #00F}
</style>
</head>
<body>
<div class="box">
<div class="left">此DIV靠左</div>
</div>
</body>
</html>

 

如需转载,请注明文章出处和来源网址:http://www.divcss5.com/shili/s51872.shtml