CSS樣式

透明度css

.lucency{
            filter:alpha(opacity=80);
            opacity:0.3;
        }

背景透明度html

.lucencyBg{
     line-height: 1.5 !important;">transparent;
}

1. css hackweb

1 .pad{
2     padding:17px 0 0 17px;  /* 普通寫法 */ 
3     *padding:17px 0 0 17px; /* *爲IE7   *+html css()爲IE7 */
4     _padding:17px 0 0 17px;  /*  _爲IE6  *html css()爲IE6 */
5 }

 

2. css 設置圓角app

1 .radius{
2     -moz-border-radius: 100px;
3     -webkit-border-radius: 100px;
4     border-radius:100px;
5 }

 

3. css  盒子陰影   (x,y,陰影模糊度,陰影顏色)url

複製代碼
複製代碼
1 .shadow{
2     -moz-box-shadow: 3px 3px 4px #fff;
3     -webkit-box-shadow: 3px 3px 4px #fff;
4     box-shadow: 3px 3px 4px #fff; 
5     filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=3px, OffY=3px, Color='#ffffff');  /* 盒子陰影 IE6,IE7 */
6     -ms-filter: "progid:DXImageTransform.Microsoft.dropshadow(OffX=3px, OffY=3px, Color='#ffffff')"; /* 盒子陰影 IE8 */
7 }
複製代碼
複製代碼

 

4. css 透明度spa

1 .lucency{
2     filter:alpha(opacity=80);
3     opacity:0.8;    
4 }

 

5. css 文本超出範圍省略號代替 ( 塊級元素,強制單行)code

1 .over{
2     overflow:hidden;
3     white-space:nowrap;
4     text-overflow:ellipsis;
5 }

 

6. css 設置背景透明orm

1 .lucencyBg{
2      line-height: 1.5 !important;">transparent;
3 }

 

7. css 文字中間劃橫線效果htm

1 .txtDec{
2     text-decoration:line-through;
3 }

 

8. css 背景圖片定位  (一般爲負數)blog

1 .posBg{
2     background-position:x y;
3 }

 

9.  css 下拉框去掉三角形

1 .selectStyle{
2     appearance:none;
3     -moz-appearance:none;
4     -webkit-appearance:none;
5 }

 

10. css 輸入框沒有選中效果

1 .inp{
2     outline:none;
3 }

 

11. css 禁止頁面圖片拖曳 ( body )

1 body{
2     oncontextmenu="return false" ondragstart="return false"  tstart="return false"
3 }

 

12. css 防止點擊出現透明背景問題

1 .colorBg{
2     -webkit-tap-highlight-color:rgba(0,0,0,0);
3 }

 

13. css 未知寬度水平居中 相對浮動

1 .unknow_width_center1 {position:relative; left:50%; float:left;}
2 .unknow_width_center1 li {position:relative; right:50%; z-index:2; float:left;}

 

14. css 容器內徹底居中(垂直 & 水平)

1 .parent{ position:relative; width:300px; height:300px; margin:0 auto;}
2 .child{ position:absolute; left:0; right:0; bottom:0; top:0; width:50px; height:50px; overflow:auto; margin:auto;}

 

15. css 容器內文字垂直居中

複製代碼
複製代碼
1 .outer { display:table; width:578px; overflow:hidden;}
2 .middle {display:table-cell; vertical-align:middle;}

複製代碼
複製代碼
1 /*下面的CSS是針對IE7,IE6*/
2 <!--[if lte IE 7]>
3 <style>
4 .outer{position:relative;}
5 .middle{position: absolute; top: 50%;}
6 .inner{position: relative; top:-50%}
7 </style> 
8 <![endif]-->
複製代碼
複製代碼
複製代碼
複製代碼

 

16. css 輸入框/輸入區域不可隨意拖動大小

1 .textarea{ resize:none; }

 

17. css radio / checkbox 選中樣式設置

複製代碼
 1 input[type=radio]{
 2     -webkit-appearance: none;
 3     appearance: none;
 4     width:15px;
 5     height:15px;
 6     margin-top:-2px;
 7     margin-left:3px;
 8     cursor: pointer;
 9     vertical-align:middle;
10     -webkit-border-radius:15px;
11     -moz-border-radius:15px;
12     border-radius:15px;
13     border:1px solid #e29452;
14     ">#fff;
15 }
16 input[type=radio]:checked::after {
17     content: url(../images/check.png);
18     margin-left:1px;
19 }
相關文章
相關標籤/搜索