1.overflow:hidden的作用是隱藏溢出比如:<div style="width:300px;overflow:hidden" id=1><div id=2></div><div>當ID=2的這個DIV高度設定的寬度超過了300px,那么超出的部分將自動被隱藏
2.line-height指的是在DIV中的元素上下居中
比如用在<li>里,則可以將line-height的高度和height的值相等,(height:30px; line-height:30px;)這樣可以讓文字在<li>內相對于30px垂直居中。比如用在<p>內,像這樣成段落的,如果不加line-height,行與行之間距離會很近,若在<p>屬性內加上line-height:22px;則每行之間的行距都是22px,會顯得不會太擁擠.
3.clearfix:after清除浮動css內容如下:.clearfix:after{content: ".";display: block;height: 0;clear: both;visibility: hidden;}.clearfix{zoom:1;}/*for ie6*/* html .clearfix {height: 1%;}/* for macIe*/
在html代碼如下:
<div style="border:2px solid red;" class="clearfix">
這樣就可以實現清除浮動了
新聞熱點
疑難解答