清除浮动
.clearfix:after{/*伪元素是行内元素 正常浏览器清除浮动方法*/
content: "";
display: block;
height: 0;
clear:both;
visibility: hidden;
}
.clearfix{
*zoom: 1;/*ie6清除浮动的方式 *号只有IE6-IE7执行,其他浏览器不执行*/
}
让页面里的字体变清晰,变细用 CSS 怎么做?
-webkit-font-smoothing: antialiased;
overflow: scroll 时不能平滑滚动的问题怎么处理?
一个 div 使用了 overflow:scroll; ,在移动端可以滚动,但是无法平滑滚动(就像浏览网页那样)
开启滚动硬件加速:
-webkit-overflow-scrolling: touch;
css三角形
.demo {
width: 0;
height: 0;
border-width: 20px;
border-style: solid;
border-color: transparent transparent red transparent;
}
文本溢出隐藏
单行
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
多行
overflow: hidden;
text-overflow: ellipsis;
display:-webkit-box;
-webkit-box-orient:vertical;
-webkit-line-clamp:2;