<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>

        • 健康| 泉州市| 巴南区| 延边| 兴化市| 忻州市| 长乐市| 峡江县| 郑州市| 锡林浩特市| 崇左市| 通江县| 武平县| 将乐县| 龙泉市| 留坝县| 平安县| 侯马市| 乌鲁木齐县| 闵行区| 湘阴县| 白朗县| 叶城县| 康定县| 滕州市| 嘉鱼县| 安多县| 奉化市| 海丰县| 穆棱市| 汝城县| 增城市| 修武县| 北宁市| 凉山| 阜新| 睢宁县| 江安县| 临泽县| 宣城市| 潢川县|