goTOP
May 28, 2018

CSS Selector 在CLASS中包含某個字便改變設定

| |
網頁語言 » CSS | 閱覽(1795) | Posted by apao at 14:54
說明:在CSS 的Class名稱中,只要包含「test」便改變屬性設定
點擊在新視窗中瀏覽此圖片
中文範例:點這裡
CSS部分:

div[class*="test"]{
  background:rgba(255,0,0,1.00);
  color: #ffffff;
}



HTML部分:

<body>
  <div class="first_test">第一個 DIV 元素</div>
  <div class="second">第二個 DIV 元素</div>
  <div class="test">第三個 DIV 元素</div>
  <p class="test">第一個 test P 段落的本文</p>
</body>



英文原文範例:點這裡
Facebook twitter LINEk
文章来自: 本站原創
Tags: , , ,
0 Comment(s)
我要發表評論
暱稱
密碼 [ 訪客無需密碼 ]
電郵
網址
開啟HTML 開啟UBB 開啟表情 隱藏 記住我