移動端公共樣式庫

說明文件地址:http://www.chinahufei.com/common/common/readme/m.ch.css.html

/**
2017年6月23日10:21:06  by hufei
 */
@charset "utf-8";
/*字體*/
@font-face {
    font-family:"PingFang Light","microsoft yahei","Arial","Helvetica Neue", "Helvetica", "STHeiTi", sans-serif;
}
html, body {
    height: 100%;
    font-size: 100px;
}
body {
    min-width: 3.2rem;
    width: 100%;
}
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, menu, nav, output, ruby, section, summary, time, mark, audio, video,textarea,input {
    margin: 0;
    padding: 0;
    border: 0 none;
    outline: none;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    font-family: PingFang Light;
    font-size: 1em;
    /* appearance: inherit;
    -webkit-appearance: inherit; */
    -webkit-tap-highlight-color: transparent;
}
ol, ul, li {
    list-style: none;
}
em, i, s {
    font-style: normal;
    text-decoration: none;
}
a {
    text-decoration: none;
    cursor: pointer;
}
a:focus{
    outline:none;
}
input:focus{
    outline:none;
    outline-color: inherit;
}
img {
    border: 0;
    vertical-align: middle;
}
table {
    width:100%;
    border-collapse: collapse; 
    border-spacing:0;
    font-size:inherit;
}
table th,table td{
    padding:5px;
}
table td{
    text-align: center;
}
textarea {
    resize:none;
    padding: 5px;
}
input[type="text"],
input[type="password"],
select,
textarea{
    border:0;
    /*background-color:#fff;*/
    border:1px solid #e5eaed;
}
input[type="checkbox"],input[type="radio"]{
    vertical-align: middle;
}
button {
    border:0;
    cursor:pointer;
    _cursor:hand;
    outline:none;
}
input:focus,select:focus{
     border-color: #66afe9;
      outline: 0;
      /*-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6);
              box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6);*/
}
p{
    word-wrap: break-word;
    word-break: normal;
}
.fl {
    float: left;
}

.fr {
    float: right;
}
.clearfix::after, .clearfix::before {
    content: '';
    display: block;
}
.clearfix::after{
    clear:both;
}
.clearfix{
    zoom:1;
}
.relative{
    position: relative;
}
.absolute{
    position: absolute;
}
.fixed{
    position: fixed;
}
.overflowHidden{
    overflow: hidden;
}
.show{
    display: block;
}
.hide{
    display: none;
}
.inlineBlock{
    display:inline-block;
}
.visiHidden{
    visibility: hidden;
}
.noPadding{ 
    padding:0!important;
}
.noBorder{
    border: none!important;
}
.border{
    border:1px solid #eeeff1;
}
.margin0Atuo{
    margin:0 auto;
}
.textCenter{
    text-align: center;
}
.textLeft{
    text-align: left;
}
.textRight{
    text-align: right;
}
.lineThrough{
    text-decoration: line-through;
}
.underLine{
    text-decoration: underline;
}
.verticalMidle{
    vertical-align: middle;
}
.verticalTop{
    vertical-align: top;
}
.textOverflow{
    white-space: nowrap;
    overflow: hidden;
    -ms-text-overflow: ellipsis;
    text-overflow: ellipsis;
}
.heightAuto{
    height:auto;
}
.widthAuto{
    width:auto;
}
.width100{
    width: 100%;
}
.height100{
    height: 100%;
}
.imgOutside{
    position: relative;
    width: 100%;
    height: 0;
    padding-top: 100%;
}
.circle50per{
    -webkit-border-radius: 50%;
    border-radius: 50%;
}
.commonImgHeight {
    display: block;
    width: auto;
    height: 100%;
    margin:0 auto;
}
.commonImgWidth {
    width: 100%;
    height: auto;
    display: block;
}
.centerMiddleFlex{
    display: flex;
    justify-content: center;
    align-items: center;
}
/*垂直居中需設置寬高*/
.centerMiddleAbs{
    /*需要自行設置寬高行高*/
    position: absolute;
    left:50%;
    top: 50%;
    width: inherit;
    height: inherit;
    line-height: inherit;
    text-align: center;
    -webkit-transform: translate(-50%,-50%);
    -ms-transform: translate(-50%,-50%);
    transform: translate(-50%,-50%);
}
/*垂直居中table法,外層盒子需設置display:table屬性*/
.centerMiddleTable{
    display:table-cell;
    vertical-align:middle;
    text-align: center;
}
/*頂部header和table固定,需設定高和其他樣式*/
.stikyHeader{
    position:fixed; 
    left:0;
    top:0;
    z-index: 5;
    width:100%; 
}
/*底部footer固定,需設定高和其他樣式*/
.stikyFooter{
    position:fixed;
    left:0;
    bottom:0; 
    z-index: 5;
    width:100%;
}
/*柵格系統*/

.col-box::before,.col-box::after{
    display: table;
    content: " ";
}
.col-box::after{
    clear: both;
}
.col-1,.col-2,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9,.col-10,.col-11,.col-12 {
    float: left;
    position: relative;
    min-height: 1px;
    padding: 0 0.1rem 0 0.1rem;
}
.col-12{
    width: 100%;
}
.col-11 {
    width: 91.66666667%;
}
.col-10 {
    width: 83.33333333%;
}
.col-9 {
    width: 75%;
}
.col-8 {
    width: 66.66666667%;
}
.col-7 {
    width: 58.33333333%;
}
.col-6 {
    width: 50%;
}
.col-5 {
    width: 41.66666667%;
}
.col-4 {
    width: 33.33333333%;
}
.col-3 {
    width: 25%;
}
.col-2 {
    width: 16.66666667%;
}
.col-1 {
    width: 8.33333333%;
}
.col-offset-12 {
    margin-left: 100%;
}
.col-offset-11 {
    margin-left: 91.66666667%;
}
.col-offset-10 {
    margin-left: 83.33333333%;
}
.col-offset-9 {
    margin-left: 75%;
}
.col-offset-8 {
    margin-left: 66.66666667%;
}
.col-offset-7 {
    margin-left: 58.33333333%;
}
.col-offset-6 {
    margin-left: 50%;
}
.col-offset-5 {
    margin-left: 41.66666667%;
}
.col-offset-4 {
    margin-left: 33.33333333%;
}
.col-offset-3 {
    margin-left: 25%;
}
.col-offset-2 {
    margin-left: 16.66666667%;
}
.col-offset-1 {
    margin-left: 8.33333333%;
}
.col-offset-0 {
    margin-left: 0;
}
/*flex系統不與float、vertical-align共用*/
.flexLeftTop{
    display: flex;
}
.flexCenterTop{
    display: flex;
    justify-content: center;
}
.flexRightTop{
    display: flex;
    justify-content: flex-end;
}
.flexLeftCenter{
    display: flex;
    align-items: center;
}
.flexMiddleCenter{
    display: flex;
    justify-content: center;
    align-items: center;
}
.flexRightCenter{
    display: flex;
    justify-content: flex-end;
    align-items: center;
}
.flexLeftBottom{
    display: flex;
    align-items: flex-end;
}
.flexCenterBottom{
    display: flex;
    justify-content: center;
    align-items: flex-end;
}
.flexRightBottom{
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
}

/*多項目排列*/
.flexManyItems{
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-content: flex-start;
}
.topBottomFixed{
    display: flex;
    flex-wrap: wrap;
    align-content: space-between;
}
.leftRightFixed{
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    align-content: space-between;
}
/*網格佈局*/
.flex{
    display: flex;
}
.flexCell{
    flex: 1;
}
.flexCellFull{
    flex: 0 0 100%;
}
.flexCell1of2{
    flex: 0 0 50%;
}
.flexCell1of3{
    flex: 0 0 33.333%;
}
.flexCell1of4{
    flex: 0 0 25%;
}

/*聖盃佈局*/
.holyGrailBox{
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}
.holyGrailHeader,
.holyGrailFooter{
    flex: 1;
}
.holyGrailBody{
    display: flex;
    flex: 1;
}
.holyGrailContent{
    flex: 1;
}
.holyGrailNav,
.holyGrailAds{
    flex: 0 0 12em;
}
.holyGrailNav{
    order: -1;
}
/*調用示例:
<div class="holyGrailBox">
<div class="holyGrailHeader">頭部</div>
<div class="holyGrailBody">
<div class="holyGrailContent">內容</div>
<div class="holyGrailNav">導航</div>
<div class="holyGrailAds">廣告</div></div>
<div class="holyGrailFooter">底部</div></div>*/

/*流式佈局*/
.fluidLayoutParent{
    display: flex;
    flex-flow: row wrap;
    align-content: flex-start;
}
.fluidLayoutChild{
    box-sizing: border-box;
    flex: 0 0 25%;
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章