zoukankan      html  css  js  c++  java
  • WebApp开发经验

    1.自适应屏幕

    <meta name="viewport" id="viewport"
    content="width = device-width, initial-scale = 1, minimum-scale = 1, maximum-scale = 1">
    2.重置页面所有元素
    /*reset*/
    html {
    -webkit-text-size-adjust: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    word-break: break-all;
    height: 100%;
    font-size: 62.5%;
    color: #999; }

    body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, textarea, p, blockquote, th, td, hr, button, article, aside, details, figcaption, figure, footer, header, menu, nav, section {
    margin: 0;
    padding: 0; }

    article, aside, details, figcaption, figure, footer, header, menu, nav, section {
    display: block; }

    audio, canvas, video {
    display: inline-block; }

    body, button, input, select, textarea {
    font: 400 1.2rem/1.2 "Hiragino Sans GB W3","Hiragino Sans GB",SimHei,sans-serif; }

    a, input, button, select, textarea {
    -webkit-tap-highlight-color: transparent; }

    textarea {
    resize: none;
    overflow-y: auto; }

    img {
    border: 0;
    vertical-align: middle;
    padding: 0;
    margin: 0; }

    iframe {
    display: block; }

    del {
    text-decoration: line-through; }

    ul {
    list-style: none; }

    ol {
    list-style-position: inside; }

    h1, h2, h3, h4, h5, h6 {
    font-weight: 500; }

    sub, sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline; }

    sup {
    top: -0.5em; }

    sub {
    bottom: -0.25em; }

    a {
    text-decoration: none;
    color: #999; }
    input,textarea,button{outline:none}

    table {
    border-collapse: collapse;
    border-spacing: 0; }
    textarea::-webkit-input-placeholder {
    color: #ccc !important;
    }
    3.规则谨记
    ①字体用rem,其余所有元素设置均用px。
    ②慎用表格。使用ul>li*3来代替。
    ③不要使用图片填充屏幕,特别是100%,容易引发意想不到的bug。
    ④使用div时切记一条反常理做法:div{100%;margin:0 2px},会造成纵向滚动。
    ⑤input,img等单标签要闭合。养成良好的习惯。
    4.模态窗口简单设计
    .modal-bg{
    position:fixed;
    top:0;
    left:0;
    100%;
    height:100%;
    z-index:20;
    background-color:black;
    filter:alpha(opacity=80);
    -moz-opacity:0.8;
    opacity:0.8;
    display:none;
    }
    <!--80%透明度遮罩层 -->
    <div class="modal-bg"></div>
    今天就先写这么多吧。


  • 相关阅读:
    POJ 3630 Phone List/POJ 1056 【字典树】
    HDU 1074 Doing Homework【状态压缩DP】
    POJ 1077 Eight【八数码问题】
    状态压缩 POJ 1185 炮兵阵地【状态压缩DP】
    POJ 1806 Manhattan 2025
    POJ 3667 Hotel【经典的线段树】
    状态压缩 POJ 3254 Corn Fields【dp 状态压缩】
    ZOJ 3468 Dice War【PD求概率】
    POJ 2479 Maximum sum【求两个不重叠的连续子串的最大和】
    POJ 3735 Training little cats【矩阵的快速求幂】
  • 原文地址:https://www.cnblogs.com/cshi/p/5671469.html
Copyright © 2011-2022 走看看