引用css樣式時,一個class引用兩個樣式的寫法( class=”ico001 icoCom”)。

來源:互聯網
上載者:User

一般在如下情況下使用:

 

Test001.jsp

<div id="contents">

    <h1 class="ico001 icoCom">title 001</h1>

</div>

使用兩種樣式時,中間用空格隔開即可

 

Test002.jsp

<div id="contents">

    <h1 class="ico002 icoCom">title 001</h1>

</div>

------------------------------------------------------------------關於優先順序:

icoCom的優先順序高於ico001

 

------------------------------------------------------------------

好處:

css檔案中

div#contents h1.ico001 {

 

}

div#contents h1.ico002 {

}

div#contents h1.icoCom{

 

}

如果不這麼寫,需要在ico001 ico002中追加重複的內容。

 

來源:

sp畫面對應,pc sp共有一個畫面,

但是應用的css不同,sp時會將icoCom的css引入。

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.