zoukankan      html  css  js  c++  java
  • 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}
  • 相关阅读:
    洛谷 P3138 [USACO16FEB]Load Balancing S(二维前缀和,离散化)
    洛谷 P1052 [NOIP2005 提高组] 过河(dp,数学)
    洛谷 P1955 [NOI2015] 程序自动分析(并查集,离散化)
    洛谷 P3258 [JLOI2014]松鼠的新家(树上差分,lca)
    洛谷 P2296 [NOIP2014 提高组] 寻找道路(反图bfs)
    洛谷 P4141 消失之物(dp方案数)
    洛谷 P5322 [BJOI2019]排兵布阵(dp,分组背包)
    回溯算法
    分治法
    分支限界法
  • 原文地址:https://www.cnblogs.com/jifengdehao/p/5586960.html
Copyright © 2011-2022 走看看