落伍者站长论坛's Archiver

moying 发表于 2008-5-30 16:10

DIV+CSS页面中clear:both;具体用法

CSS中 clear:both;可以终结在出现他之前的浮动 CSS中 clear:both;可以终结在出现他之前的浮动

例如
<style>
.demodiv{float:left;width:100px;height:50px;background:red;margin:5px;}
.d{clear:both}
</style>
<div class="demodiv">1</div>
<div class="demodiv">2</div>
<div class="d"></div>
<div class="demodiv">3</div>
<div class="demodiv">4</div>
效果:
[img]http://www.baiqoo.com/eWebEditor/UploadFile/2007102910016311.jpg[/img]
语法: clear : none | left |right | both 参数: none : 允许两边都可以有浮动对象 both : 不允许有浮动对象 left : 不允许左边有浮动对象 right : 不允许右边有浮动对象 说明: 该属性的值指出了不允许有浮动对象的边。请参阅float属性。 对应的脚本特性为clear。请参阅我编写的其他书目。 示例: div { clear : left } img { float: right }

moying 发表于 2008-5-30 16:10

今天有从同事那里学到这个
一起学习

人白 发表于 2008-5-30 18:07

呵呵。。。我只会ps,其他嘛也不会~~

财富365 发表于 2008-5-31 14:20

不会

页: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.