[問題] 一個element套用多個class

看板Web_Design作者 (4545454554)時間7年前 (2018/03/12 17:28), 7年前編輯推噓1(101)
留言2則, 1人參與, 7年前最新討論串1/1
https://goo.gl/29io7h 上面提到 a single element can have multiple class names separated by white space 當這些class的設定有衝突時 會怎麼處裡呢? 我稍微測試一下 程式碼如下 https://jsfiddle.net/2bw402nn/1/ 第1個div和第2個div 與預期相符 第3個div和第4個div 結果完全一樣 我的問題是 為什麼 <div class="c3 c4"></div> 和 <div class="c4 c3"></div> 會一樣呢? 謝謝  -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 60.251.182.4 ※ 文章網址: https://www.ptt.cc/bbs/Web_Design/M.1520846921.A.760.html

03/12 17:54, 7年前 , 1F
比較下面的規則會蓋掉上面的
03/12 17:54, 1F

03/12 17:57, 7年前 , 2F
03/12 17:57, 2F
謝謝 我誤以為class="c3 c4"表示c4在下面, class="c4 c3"表示c3在下面 ※ 編輯: kisha024 (114.40.118.46), 03/12/2018 18:40:51
文章代碼(AID): #1QfaX9TW (Web_Design)
文章代碼(AID): #1QfaX9TW (Web_Design)