CSS代码片段
1.清除浮动
.f_ib{ display:inline-block; *zoom:1; *display:inline; }
2.display:inline-block
.f_ib{ display:inline-block; *zoom:1; *display:inline; }
3.文本超出显示省略号
.f_toe{ overflow:hidden; word-wrap:normal; white-space:nowrap; text-overflow:ellipsis; }
4.禁止选择文本
.f_toe{ overflow:hidden; word-wrap:normal; white-space:nowrap; text-overflow:ellipsis; }
5.设置最小高度
.min_height{ min-height:300px; _height:300px; }
6.有高宽的容器窗口居中
.align_middle{ width:200px; height:100px; position:absolute; top:50%; left:50%; margin:-50px 0 0 -100px; }
7.透明度
.opacity{ background-color:#000; opacity:0.5; filter:alpha(opacity=50); }
8.小高度设置
.mini_height{ height:3px; font-size:0; overflow:hidden; }
9.去掉a标签的虚线框
.hidefocus{ outline:none; } <a href="#" hidefocus="true" class="hidefocus"></a>
10. a标签访问样式设置,注意顺序
a:link { color:red; } a:visited { color:green; } a:hover { color:blue; } a:active { color:orange; }