• css的技巧


    1. 文字换行

    /*强制不换行*/
    white-space:nowrap; 
    /*自动换行*/
    word-wrap: break-word;
    word-break: normal;
    /*强制英文单词断行*/
    word-break:break-all;

    2. 两端对齐

    text-align:justify;text-justify:inter-ideogra

    3. 去掉Webkit(chrome)浏览器中input(文本框)或textarea的黄色焦点框

    input,button,select,textarea{ outline:none;}
    textarea{ font-size:13px; resize:none;}

    注:去掉chrome记住密码后自动填充表单的黄色背景

    4. ie6: position:fixed

    .fixed-top /* position fixed Top */{position:fixed;bottom:auto;top:0; }
    * html .fixed-top /* IE6 position fixed Top */{position:absolute;bottom:auto;top:expression(eval(document.documentElement.scrollTop));}
    *html{background-image:url(about:blank);background-attachment:fixed;}

    5. clearfix

    .clearfix:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0;}
    .clearfix{display:inline-block;}
    html[xmlns] .clearfix{display:block;}
    * html .clearfix{height:1%;}
    .clearfix{*zoom: 1;}
    .clearfix:after{clear:both;display:table;content:"”;}
    .clearfix{overflow:hidden;_zoom:1;}

    6. seperate-table

    .tab{border-collapse:separate;border:1px solid #e0e0e0;}
    .tab th,.tab td{padding:3px;font-size:12px;background:#f5f9fb;border:1px solid;border-color:#fff #deedf6 #deedf6 #fff;}
    .tab th{background:#edf4f0;}
    .tab tr.even td{background:#fff;}
    <table class="tab" width="100%" cellpadding="0" cellspacing="0" border="0"> 
        <tr>
            <th>111</th>
            <td>222</td>
        </tr>
        <tr>
            <th>111</th>
            <td>222</td>
       </tr>
    </table>

    7. min-height: 最小高度兼容代码

    .minheight500{
         min-height:500px;
         height:auto !important;
         height:500px;
         overflow:visible;
    }

    8. 鼠标不允许点击:

    cursor:not-allowed;

    9. mac font: osx平台字体优化

    font-family:"Hiragino Sans GB","Hiragino Sans GB W3",'微软雅黑';

    10. 省略号:

    .ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  • 相关阅读:
    CSP-S2019游记
    小程序回馈模块,测试陷入泥沼
    送测质量烂的一匹,还要不要继续测试?
    day1 执行用例
    写了人生中第一个完整模块的用例
    项目测试中发现产品bug怎么办
    项目测试操作规范
    idea连接mysql
    自动化环境配置
    linux,无法进行写操作怎么办?read-only file system
  • 原文地址:https://www.cnblogs.com/jifengdehao/p/5586960.html
Copyright © 2020-2023  润新知