在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問(wèn)答/HTML/ css選擇器的區(qū)別

css選擇器的區(qū)別

[ attribute ~= value ] 用于選取屬性值中包含指定詞匯的元素。
[ attribute *= value ] 匹配屬性值中包含指定值的每個(gè)元素。

p[class ~= "lone"]
p[class *= "lone"]

兩者好像沒(méi)有區(qū)別哈?

回答
編輯回答
毀與悔

指定詞匯!==指定值

2017年2月26日 17:42
編輯回答
凹凸曼

[attribute~=value] matches any entry in a space-delimited list. It matches attribute="a value b", but not attribute="a valueb".

[attribute*=value] matches any substring. It matches attribute="a value b" and attribute="a valueb", but not attribute="x".

2018年6月16日 16:39
編輯回答
故人嘆
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Test</title>
  <style type="text/css">
    p[class ~= "lone"]{
      color: red;
    }
    p[class *= "abc"]{
      color: blue;
    }
  </style>
</head>
<body>
  <p class="lone">lone: 紅色</p>
  <p class="abc">abc: 藍(lán)色</p>
  <p class="lone1">lone1: 未匹配</p>
  <p class="abc1">abc1: 藍(lán)色</p>
</body>
</html>

一個(gè)是包含某個(gè),一個(gè)是包含某個(gè)字符串 是不一樣的

2018年6月28日 05:59