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 } 今天有从同事那里学到这个
一起学习 呵呵。。。我只会ps,其他嘛也不会~~ 不会
页:
[1]
