久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長(zhǎng)資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      了解css中的關(guān)鍵字initial、inherit、unset、revert和all屬性

      了解css中的關(guān)鍵字initial、inherit、unset、revert和all屬性

      在CSS中,有4個(gè)關(guān)鍵字理論上可以應(yīng)用于任何的CSS屬性,它們是initial(初始)、inherit(繼承)、unset(未設(shè)置)、revert(還原)。而all的取值只能是以上這4個(gè)關(guān)鍵字。本文將介紹initial、inherit、unset、revert和all。

      initial

      表示元素屬性的初始默認(rèn)值(該默認(rèn)值由官方CSS規(guī)范定義)

      兼容性: IE不支持

      [注意]關(guān)于各屬性的初始默認(rèn)值移步至此

      //display在官方CSS規(guī)范中定義的默認(rèn)值是inline <style> .test{display: initial;} </style> <div class="box">     <div class="test">測(cè)試一</div><span>文字</span>     <br>     <div >測(cè)試二</div><span>文字</span> </div>

      inherit

      表示元素的直接父元素對(duì)應(yīng)屬性的計(jì)算值

      兼容性: IE7-不支持

      <style> .box{     border: 1px solid black;     padding: 10px;     width: 100px; } .test{     border: inherit;     height: 30px; } </style> <div class="box">     <div class="test">測(cè)試一</div> </div> <div class="box">     <div class="in">         <div class="test">測(cè)試二</div>             </div> </div>

      unset

      unset相對(duì)于initial和inherit而言,相對(duì)復(fù)雜一點(diǎn)。表示如果該屬性默認(rèn)可繼承,則值為inherit;否則值為initial。實(shí)際上,設(shè)置unset相當(dāng)于不設(shè)置

      兼容性: IE不支持,safari9-不支持,ios9.2-不支持,android4.4.4-不支持

      【常用默認(rèn)可繼承樣式】

      color cursor direction font letter-spacing line-height list-style text-align text-indent text-shadow text-transform white-space word-break word-spacing word-wrap writing-mode
      //內(nèi)容為測(cè)試一的元素和內(nèi)容為測(cè)試二的元素的樣式是一樣的 <style> .box{     border: 1px solid black;     padding: 10px;     width: 100px;     color: red; } .test1{     border: unset;     color: unset; } </style> <div class="box">     <div class="test">測(cè)試一</div>     <div>測(cè)試二</div> </div>

      revert

      表示樣式表中定義的元素屬性的默認(rèn)值。若用戶定義樣式表中顯式設(shè)置,則按此設(shè)置;否則,按照瀏覽器定義樣式表中的樣式設(shè)置;否則,等價(jià)于unset

      兼容性: 只有safari9.1+和ios9.3+支持

      all

      表示重設(shè)除unicode-bidi和direction之外的所有CSS屬性的屬性值,取值只能是initial、inherit、unset和revert

      兼容性: IE不支持,safari9-不支持,ios9.2-不支持,android4.4-不支持

      <style> .test{     border: 1px solid black;     padding: 20px;     color: red; } .in{ /*  all: initial;     all: inherit;     all: unset;     all: revert; */ } </style> <div class="test">     <div class="in">測(cè)試文字</div>             </div>

      【1】當(dāng)all:initial時(shí),.in的所有屬性都取默認(rèn)值

      border:none;padding:0;color:black;

      【2】當(dāng)all:inherit時(shí),.in的所有屬性都取父元素繼承值

      border:1px solid black;padding:20px;color:red;

      【3】當(dāng)all:unset時(shí),.in的所有屬性都相當(dāng)于不設(shè)置值,默認(rèn)可繼承的繼承,不可繼承的保持默認(rèn)值

      border:none;padding:0;color:red;

      本文轉(zhuǎn)自:https://www.cnblogs.com/xiaohuochai/p/5464456.html

      推薦學(xué)習(xí):css快速入門(mén)

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)