<strike id="3tkic"><sup id="3tkic"></sup></strike>

  1. <ul id="3tkic"></ul>
      <b id="3tkic"><legend id="3tkic"></legend></b>
      <b id="3tkic"><meter id="3tkic"></meter></b>

    • <strike id="3tkic"></strike>

      <blockquote id="3tkic"></blockquote>

    • 亚洲AV无码国产在丝袜线观看_亚洲第一页A∨在线_亚洲国产人成在线观看69网站_无码日韩人妻AV一区免费l

      CSS中!important的作用

      2016/12/5 8:37:22   閱讀:1699    發(fā)布者:1699

      提升指定樣式規(guī)則的應(yīng)用優(yōu)先權(quán)。

      • IE6及以下瀏覽器有個比較顯式的支持問題存在,!important在同一條規(guī)則集里不生效。請看下述代碼:

        示例代碼:

        div { color: #f00 !important; color: #000; }

        在上述代碼中,IE6及以下瀏覽器div的文本顏色為#000,!important并沒有覆蓋后面的規(guī)則;
        其它瀏覽器下div的文本顏色為#f00

      • IE6及以下瀏覽器要使!important生效,可用以下代碼:

        示例代碼:

        div { color: #f00 !important; } div { color: #000; }

        在上述代碼中,IE6及以下瀏覽器中div的文本顏色表現(xiàn)與其它瀏覽器一致,都為#f00

         

        IE6及更早瀏覽器下,!important在同一條規(guī)則集內(nèi)不生效。

      示例:

       1 <!DOCTYPE html> 
       2 <html> 
       3   <head> 
       4     <title>important的使用</title> 
       5     <meta name="content-type" content="text/html; charset=UTF-8"> 
       6 <style> 
       7 .button { 
       8     position: relative; 
       9     background-color: #4CAF50; 
      10     border-radius:8px; 
      11     font-size: 28px; 
      12     color: #FFFFFF; 
      13     padding: 20px; 
      14     width: 200px; 
      15     text-align: center; 
      16     transition-duration: 1.5s; 
      17     overflow: hidden; 
      18     cursor: pointer; 
      19   } 
      20   .button:hover{ 
      21     box-shadow:0 4px 8px 0 rgba(0,0,0,0.1),0 6px 20px 0 rgba(0,0,0,0.299);   
      22   } 
      23  
      24   .button:after { 
      25     content: ""; 
      26     background: #90EE90; 
      27     display: block; 
      28     position: absolute; 
      29     padding-top: 300%; 
      30     padding-left: 350%; 
      31     margin-left: -20px!important; 
      32     margin-top: -120%; 
      33     opacity: 0; 
      34     transition:1s; 
      35 } 
      36  
      37 .button:active:after { 
      38     padding: 0; 
      39     margin: 0; 
      40     opacity: 1; 
      41     transition:0s; 
      42 } 
      43 </style> 
      44 </head> 
      45 <body> 
      46  
      47 <button class="button">Click Me</button> 
      48 <p>第31行的margin-left設(shè)置了!important,因此后面的第39行是不能更改margin-left的值。 
      50 </body> 
      51 </html>

       

      亚洲AV无码国产在丝袜线观看_亚洲第一页A∨在线_亚洲国产人成在线观看69网站_无码日韩人妻AV一区免费l
      <strike id="3tkic"><sup id="3tkic"></sup></strike>

      1. <ul id="3tkic"></ul>
          <b id="3tkic"><legend id="3tkic"></legend></b>
          <b id="3tkic"><meter id="3tkic"></meter></b>

        • <strike id="3tkic"></strike>

          <blockquote id="3tkic"></blockquote>

        • 酉阳| 北川| 唐河县| 兴安县| 湖州市| 漯河市| 阿合奇县| 五峰| 江孜县| 荣昌县| 铜山县| 呼伦贝尔市| 喜德县| 新巴尔虎左旗| 伊吾县| 松滋市| 大悟县| 象山县| 肇东市| 兴化市| 四会市| 兰坪| 金寨县| 精河县| 五峰| 明溪县| 西充县| 陕西省| 正蓝旗| 三穗县| 旬邑县| 嵊州市| 汝州市| 大兴区| 荔浦县| 萨嘎县| 和平区| 青州市| 雷山县| 昭觉县| 德阳市|