欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

overflow:hidden line-height clearfix:after使用方法介紹

  發(fā)布時(shí)間:2013-01-08 16:07:43   作者:佚名   我要評(píng)論
overflow:hidden的作用是隱藏溢出,line-height指的是在DIV中的元素上下居中接下來詳細(xì)介紹它們的用法,感興趣的朋友可以了解下哦
1.overflow:hidden的作用是隱藏溢出比如

復(fù)制代碼
代碼如下:

<div style="width:300px;overflow:hidden" id=1><div id=2></div><div>

當(dāng)ID=2的這個(gè)DIV高度設(shè)定的寬度超過了300px,那么超出的部分將自動(dòng)被隱藏

2.line-height指的是在DIV中的元素上下居中
比如用在<li>里,則可以將line-height的高度和height的值相等,(height:30px; line-height:30px;)這樣可以讓文字在<li>內(nèi)相對(duì)于30px垂直居中。比如用在<p>內(nèi),像這樣成段落的,如果不加line-height,行與行之間距離會(huì)很近,若在<p>屬性內(nèi)加上line-height:22px;則每行之間的行距都是22px,會(huì)顯得不會(huì)太擁擠.3.clearfix:after清除浮動(dòng)css內(nèi)容如下:

復(fù)制代碼
代碼如下:

.clearfix:after{content: ".";display: block;height: 0;clear: both;visibility: hidden;}
.clearfix{zoom:1;}/*for ie6*/* html .clearfix {height: 1%;}/* for macIe*/

在html代碼如下

復(fù)制代碼
代碼如下:

<div style="border:2px solid red;" class="clearfix">這樣就可以實(shí)現(xiàn)清除浮動(dòng)了

相關(guān)文章

最新評(píng)論