移動端好用的reset.css

來源:互聯網
上載者:User

標籤:cursor   outline   tip   reset   BMI   color   block   切換   tar   

html {    color: #333;    /*規定主色調,依據業務情境(非必須)*/    background: #F6F6F6;    /*規定主背景,依據業務情境(非必須)*/    overflow-y: auto;    /*如果有溢出自動形成捲軸*/    -webkit-text-size-adjust: 100%;    /*不想讓iPhone橫堅屏切換的時候調節文字*/    -ms-text-size-adjust: 100%;}html * { /*所有元素*/    outline: none;    -webkit-tap-highlight-color: rgba(0, 0, 0, 0); /*去除移動端開發點擊事件灰色背景如a標籤*/}body,html{    height: 100%;}article,aside,blockquote,body,button,code,dd,details,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,input,legend,li,menu,nav,ol,p,pre,section,td,textarea,th,ul {    margin: 0;    padding: 0;}input,select,textarea {    font-size: 100%;}table {    border-collapse: collapse;    border-spacing: 0;}fieldset,img {    border: none;}address,caption,cite,code,dfn,em,th,var {    font-style: normal;    font-weight: 500;}ol,ul {    list-style: none;}h1,h2,h3,h4,h5,h6 {    font-size: 100%;    font-weight: 500;}q:after,q:before {  /*在<q></q>標籤之間的文字兩頭加上引號*/    content: ‘‘;}a{    text-decoration: none;}/*input*/button {    border: none;}button,html input[type=‘button‘],input[type=‘reset‘],input[type=‘submit‘] {    -webkit-appearance: button;  /*渲染成button的風格*/    text-transform: none;    outline: none;}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder {    color: #999;  /*輸入框提示的字型樣式*/}input::-webkit-inner-spin-button {/*解決input的type="number"在部分手機端會出現一個小按鈕*/    -webkit-appearance: none;/*去除系統預設appearance的樣式,常用於IOS下移除原生樣式*/}input::-webkit-outer-spin-button {/*解決input的type="number"在部分手機端會出現一個小按鈕*/    -webkit-appearance: none;}textarea {    vertical-align: top;}button,input {    line-height: normal;}select {    margin: 0;    outline: 0;}input.fixAKeyboard:focus,textarea.fixAndroidKeyboard:focus {    -webkit-tap-highlight-color: rgba(255, 255, 255, 0);    -webkit-user-modify: read-write-plaintext-only;}input:-webkit-autofill {    -webkit-box-shadow: 0 0 0 1000px white inset !important;}button,input[type=button],input[type=checkbox],input[type=reset],input[type=submit],label {    cursor: pointer;    user-select: none;    -ms-user-select: none;    -moz-user-select: none;    -webkit-user-select: none;}input[type=submit] {    -webkit-user-modify: read-plaintext-only;    -moz-user-modify: read-plaintext-only;    -ms-user-modify: read-plaintext-only;    -o-user-modify: read-plaintext-only;    user-modify: read-plaintext-only;}input[type=‘search‘]::-webkit-search-cancel-button,input[type=‘search‘]::-webkit-search-decoration {    -webkit-appearance: none;}input[type=‘search‘] {    -webkit-box-sizing: content-box;    -moz-box-sizing: content-box;    box-sizing: content-box;    -webkit-appearance: textfield;}/*flex box*/.flex {    display: box;    /* OLD - Android 4.4- */    display: -webkit-box;    /* OLD - iOS 6-, Safari 3.1-6 */    display: -moz-box;    /* OLD - Firefox 19- (buggy but mostly works) */    display: -ms-flexbox;    /* TWEENER - IE 10 */    display: -webkit-flex;    /* NEW - Chrome */    display: flex;    -webkit-box-lines: multiple;    -webkit-flex-wrap: wrap;    -moz-flex-wrap: wrap;    -ms-flex-wrap: wrap;    -o-flex-wrap: wrap;    flex-wrap: wrap;}.justify-between {    -webkit-box-pack: justify;    -webkit-justify-content: space-between;    -ms-flex-pack: justify;    justify-content: space-between;}.justify-center {    -webkit-box-pack: center;    -webkit-justify-content: center;    -ms-flex-pack: center;    justify-content: center;}.vertical {    -webkit-box-orient: vertical;    -webkit-box-direction: normal;    -webkit-flex-direction: column;    -ms-flex-direction: column;    flex-direction: column;}*,*:before,*:after {    box-sizing: border-box; /*所有元素以border開始計算盒子大小*/}.clearfix:after,.clearfix:before {   /*清除浮動*/    content: " ";    display: table;}.clearfix:after {    clear: both;}.fl {    float: left;}.fr {    float: right;}

百分比布局,也叫做流式布局;
清除移動端預設的點擊高亮效果:-webkit-tap-highlight-color:transparent;
base.css:
*,::before,::after{
padding:0;
margin:0;
-webkit-box-sizing:border-box; //主流瀏覽器做相容;
box-sizing:border-box;
}

input{
border:none;
outline:none;
-webkit-appearance;//清除移動端預設的表單樣式;如內陰影製作效果;
}

布局時候搜尋方塊包一個form可以實現小鍵盤的箭頭變為搜尋二字;

 

 

 

 

移動端好用的reset.css

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.