移動WEBAPP 常規CSS樣式總結

Title:該網頁的標題,這個標題一般會顯示在瀏覽器打開該網頁時,最地址欄上面可以簡單文字段。

Meta:

<!--表示:強制讓文檔的寬度與設備的寬度保持1:1,並且文檔最大的寬度比例是1.0,且不允許用戶點擊屏幕放大瀏覽;user-scalable: 用戶是否可以手動縮放-->

<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport"/>


<!--iphone設備中的safari私有meta標籤,它表示:允許全屏模式瀏覽;-->

<meta content="yes"name="apple-mobile-web-app-capable"/>


<!--iphone的私有標籤,它指定的iphone中safari頂端的狀態條的樣式;-->

<meta content="black"name="apple-mobile-web-app-status-bar-style"/>


<!--告訴設備忽略將頁面中的數字識別爲電話號碼-->

<meta content="telephone=no"name="format-detection"/>


<!--用於忽略將頁面中郵件地址-->

<meta content="email=no"name="format-detection"/>


<!--是最大的高度限定在568Px以內,這個可以忽略,因爲我們都會用滑動來代替;當然了,可以用在頁面佈局不多的地方!-->

<meta content="initial-scale=1.0,user-scalable=no,maximum-scale=1" media="(device-height: 568px)" name="viewport" />

做移動端的時候,凡是有a標籤點擊轉鏈接的地方都會系統自帶一個透明層的點擊效果,取消點擊高亮:

-webkit-tap-highlight-color: rgba(0,0,0,0);-webkit-tap-highlight-color: transparent;


@charset "utf-8";  
html,body{background:#f0f0f0;color:#505050;font-size:62.5%;-webkit-user-select:none;-webkit-tap-highlight-color: rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-touch-callout:none;}  
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td,hr,button,article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section {margin:0;padding:0;}  
body,button,input,select,textarea {font:14px \5b8b\4f53,'Helvetica Neue',Arial,'Liberation Sans',FreeSans,'Hiragino Sans GB',sans-serif\"Microsoft YaHei"\"微軟雅黑";line-height:20px;}  
h1{font-size:24px;}  
h2{font-size:22px;}  
h3{font-size:18px;}  
@media only screen and (min-width:360px) {  
    h1{font-size:28px;}  
    h2{font-size:26px;}  
    h3{font-size:22px;}  
    body,button,input,select,textarea {font-size:18px;line-height:26px;}  
}  
h1,h2,h3,h4,h5,h6 {font-weight:normal;}  
html, body, form, fieldset, p, div, h1, h2, h3, h4, h5, h6 {-webkit-text-size-adjust:none;}/*阻止旋轉屏幕時自動調整字體大小*/  
textarea{resize:none;}  
/*取消按鈕在inphone上的默認樣式*/  
input[type=button]{-webkit-appearance:none;outline:none}   
input::-webkit-input-placeholder{color:#F0F0F0;}  
textarea::-webkit-input-placeholder{color:#F0F0F0;}  
input::-webkit-input-speech-button {display:none}  
table {border-collapse:collapse;border-spacing:0;}  
th {text-align:inherit;}  
fieldset,img {border:none;}  
abbr,acronym {border:none;font-variant:normal;}  
del {text-decoration:line-through;}  
ol,ul {list-style:none;}  
caption,th {text-align:left;}  
sub,sup {font-size:75%;line-height:0;position:relative;vertical-align:baseline;}  
sup {top:-0.5em;}  
sub {bottom:-0.25em;}  
ins,a,a:hover {text-decoration:none;}  
a:focus,*:focus {outline:none;}  
.clearfix:before,.clearfix:after {content:"";display:table;}  
.clearfix:after {clear:both;overflow:hidden;}  
.clearfix {zoom:1;}  
.clear {clear:both;display:block;font-size:0;height:0;line-height:0;overflow:hidden;}  
.hide {display:none;}  
.block {display:block;}  
.outL{white-space:normal;word-break:break-all;width:100px;}  
.outH{overflow:hidden;text-overflow:ellipsis;white-space:nowrap; width:100px;}  
/*佈局*/  
.fl{float:left;display:inline;}  
.fr{float:right;display:inline;}  
.cb{clear:both;}  
.cl{clear:left;}  
.cr{clear:rigth;}  
.rel{position:relative;}  
.abs{position:absolute;}  
.tac{text-align:center;}  
.tal{text-align:left;}  
.tar{text-align:right;}  
.dib{display:inline-block;}  
.vab{vertical-align:bottom;}  
.vam{vertical-align:middle;}  
.vat{vertical-align:top;}  
/*網格*/  
.box{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;height:100%;text-align:center;padding:5px 0;}  
.grid,.wrap,.grid:after,.wrap:after,.grid:before,.wrap:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}  
.grid{*zoom:1}  
.grid:before,.grid:after{display:table;content:"";line-height:0}  
.grid:after{clear:both}  
.grid{list-style-type:none;padding:0;margin:0}  
.grid>.grid{clear:none;float:left;margin:0 !important}  
.wrap{float:left;width:100%}  
/*網格*/  
/*flex*/  
.col{height:100%;display:-webkit-box;-webkit-box-orient:vertical;display:flex;display:-webkit-flex;flex-direction:column;}  
.row{display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap;flex-direction:wrap;display:-webkit-box;-webkit-box-orient:horizontal;-webkit-box-lines:multiple;width:100%;height:auto;margin:auto;}  
.flex1{-webkit-box-flex:1;-webkit-flex:1;flex:1;}  
.flex2{-webkit-box-flex:2;-webkit-flex:2;flex:2;}  
.flex3{-webkit-box-flex:3;-webkit-flex:3;flex:3;}  
/*flex*/  
/*容器*/  
.wrapper{position:absolute;top:0;right:0;bottom:0;left:0;padding:5px 5px 60px 5px;overflow:auto;margin-top:44px;-webkit-overflow-scrolling:touch;}  
/*頭尾*/  
header,footer{position:fixed;right:0;left:0;z-index:1;text-align:center;background:#CCCCCC;}  
header{top:0;height:44px;}  
footer{bottom:0;}  
  
/*寬度*/  
.w100p{width:100%}  
.w20p{width:20%;}  
  
/*邊距*/  
.m5{margin:5px;}  
.p5{padding:5px;}  
.pt5{padding-top:5px;}  


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章