原文鏈接:http://caibaojian.com/mobile web app fix.html 寫一個好的web app初始化樣式很重要,以下為之前的flexible.js中項目的同個樣式。 ...
原文鏈接:http://caibaojian.com/mobile-web-app-fix.html
寫一個好的web app初始化樣式很重要,以下為之前的flexible.js中項目的同個樣式。
原文鏈接:http://caibaojian.com/mobile-web-app-fix.html
@charset"utf-8";
html {
color: #000;
background: #fff;
overflow-y: scroll;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
html * {
outline:none;
-webkit-text-size-adjust: none;
-webkit-tap-highlight-color:rgba(0, 0, 0, 0);
}
html, body {
font-family: sans-serif;
}
/* 內外邊距通常讓各個瀏覽器樣式的表現位置不同 */
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;
}
input, select, textarea {
font-size: 100%;
}
/* 去掉各 Table cell 的邊距並讓其邊重合 */
table {
border-collapse: collapse;
border-spacing: 0;
}
/* 去除預設邊框 */
fieldset, img {
border: 0;
}
/* 去掉 firefox 下此元素的邊框 */
abbr, acronym {
border: 0;
font-variant: normal;
}
/* 一致的 del 樣式 */
del {
text-decoration: line-through;
}
address, caption, cite, code, dfn, em, th, var {
font-style: normal;
font-weight: 500;
}
/* 去掉列表前的標識, li 會繼承 */
ol, ul {
list-style: none;
}
/* 對齊是排版最重要的因素, 別讓什麼都居中 */
caption, th {
text-align: left;
}
/* 來自 yahoo, 讓標題都自定義, 適應多個系統應用 */
h1, h2, h3, h4, h5, h6 {
font-size: 100%;
font-weight: 500;
}
q:before, q:after {
content:'';
}
/* 統一上標和下標 */
sub, sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
/* 正常鏈接 未訪問 */
a:link {
}
/* 滑鼠懸停 */
a:hover {
text-decoration: underline;
}
/* 預設不顯示下劃線,保持頁面簡潔 */
ins, a {
text-decoration: none;
}