1. 程式人生 > >css初始化重置

css初始化重置

family nor 重復 char 字體 解決 輸入框 dede ner

在網上找了很久,有結合自己做的

@charset ‘UTF-8‘;

/*
    document   : css初始化 重復class類
    Created on : 2017-07-13
    Author     : 
    Description:
                css樣式表的初始化,全局樣式設置

 */

html,body,div,ul,ol,li,p,a,i,em,img,form,input,textarea,h1,h2,h3,h4,h5,h6,::before,::after {
    margin: 0;
    padding: 0;
    -webkit-top-height-color
: transparent;/* 點擊高亮透明 */ -webkit-text-size-adjust:none; /* 阻止旋轉屏幕時自動調整字體大小 */ -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } body { color: #000; font: 12px/1.4 ‘Microsoft YaHei‘,Arial,sans-serif; background-color: #fff; overflow-x
: hidden; /* 解決上下拉動滾動條時卡頓,慢 */ -webkit-overflow-scrolling: touch; -moz-overflow-scrolling: touch; overflow-scrolling: touch; } a { text-decoration: none; color: #000; background-color: transparent; } ol,ul { list-style-type: none; } img { border: 0; vertical-align
: middle; } p { word-wrap: break-word; } em { font-style: normal; } input,button,select,textarea { resize: none;/* 禁止textarea拉伸 */ outline: none; -webkit-appearance: none;/* 解決iphone及ipad下輸入框默認內陰影 */ line-height: normal;/* 解決placeholder在移動端偏上問題 */ -webkit-transform: translate3d(0,0,0);/* 解決低版本微信事件無法觸發 */ font-family: inherit; font-size: inherit; line-height: inherit; border: 1px solid #ccc; padding: 1px; } input[type=text]:focus { border: 1px solid #ccc; } h1,h2,h3,h4,h5,h6 { font-size: 100%; font-weight: normal; } /* 清除浮動 */ .clearfix:before, .clearfix:after { content: ‘‘; display: block; height: 0; line-height: 0; visibility: hidden; clear: both; } /* 解決Input type = number 錯亂問題 */ input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; -moz-appearance: none; appearance: none; } /* 針對於bootstap重置 */ a:focus,a:hover { color: #000; text-decoration: none; } /* 重復使用 */ .layout { position: relative; } .container-fluid { padding-right: 15px; padding-left: 15px; margin-right: auto; margin-left: auto; } .w { display: block; width: 100%; } .w75 { width: 75%; } .w50 { width: 50%; } .w33{ width: 33.333333%; } .w25{ width: 25%; } .h { display: block; height: 100%; } .wh { display: block; width: 100%; height: 100% } ul.block { /* 解決ul沒有高 */ overflow: hidden; } .omit { /* 單行省略 */ overflow: hidden; text-overflow: ellipsis; white-space:nowrap; } /* 多行省略 */ .more_omit { display: -webkit-box; overflow: hidden; text-overflow: ellipsis; -webkit-box-orient: vertical; -webkit-line-clamp: 3; /* 顯示幾行寫幾 */ } .left { float: left; } .right { float: right; } .center { margin-left: auto; margin-right: auto; } /* CSS樣式小箭頭 */ .arrow { padding: 20px; } .arrow i { display: inline-block; width: 0; height: 0; border-width: 8px; } .arrow_top { border-color: transparent transparent #000 transparent; /* 向上箭頭 */ border-style: solid; } .arrow_right { border-color: transparent transparent transparent #000; /* 向右箭頭 */ border-style: solid; } .arrow_bottom { border-color: #000 transparent transparent transparent; /* 向下箭頭 */ border-style: solid; } .arrow_left { border-color: transparent #000 transparent transparent; /* 向左箭頭 */ border-style: solid; } /* 四周陰影 */ .box_shadow { box-shadow: 0 0 10px #dedede; border: 1px solid #dedede; }

css初始化重置