java中Math類的常用函數

來源:互聯網
上載者:User

標籤:cms   hpc   dia   back   inline   媒體查詢   idt   scope   ade   

特別的,有一個新的屬性,它能讓我們控制多個元素的屬性,就是:scoped。style標記上新出現的這個scoped屬性可以讓CSS樣式只對局部元素生效,具體說,就是存放這段style樣式的元素的子項目生效,跟平常的樣式不一樣的唯一地方就是新加了一個scoped屬性:

複製代碼代碼如下:
<style scoped>
/* styles go here */
</style>

 

具有scoped屬性的樣式只會應用到當前元素和其子項目。Inline樣式仍然比scoped樣式優先順序高,所以,最好避免使用inline樣式,下面是將幾種樣式混合到一起比較它們的作用效率範圍:

複製代碼代碼如下:
<div class="democontain lazy ">
<style scoped>
div { border: 1px solid green; margin-bottom: 20px; min-height: 40px; }
.democontain { background: #f8f8f8; }
</style>
<div></div>
<div style="border-color: pink;">
<style scoped>
div { background: lightblue; border: 1px solid blue; }
</style>
<div></div>
</div>
<div></div>
</div>

 

在scoped樣式裡可以使用任何合法的CSS樣式標記,比如媒體查詢,就像下面這樣:

 

複製代碼代碼如下:
<style scoped>
@media only screen and (max-width : 1024px) {
div { background: #000; }
}
</style>

 

這個新出現的scoped屬性是非常有用的功能,尤其對那些創作模板的,或CMS使用者,或某些無法操作整個樣式檔案的開發人員。但需要注意的是,有些老式的瀏覽器上不支援這個屬性的,在這種時候,你也許需要使用jQuery外掛程式(https://github.com/thingsinjars/jQuery-Scoped-CSS-plugin)來彌補這種問題。

java中Math類的常用函數

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.