有什么区别:| =和^ =在css中?
由于这个链接它不是一个,但为什么他们会打扰两件事重复.
http://www.w3schools.com/cssref/css_selectors.asp
[attribute | = value]和[attribute ^ = value]
首先是
Selects every element whose src attribute value begins with
@H_404_13@
“https”第二个
Selects all elements with a lang attribute value starting with “en”
@H_404_13@
解决方法
我认为w3c文档中的官方描述说明了一切:
E [foo | =“en”] – 一个E元素,其foo属性值是一个以连字符分隔的值列表,以en开头
E [foo ^ =“bar”] – 一个E元素,其foo属性值恰好以字符串“bar”开头
Always try to avoid using w3schools – it has very poor quality.
要获得良好的文档,请访问MDN或Sitepoint或使用官方W3C Document.
基本上,| =选择器对复合类和语言属性很有用.
<div class="wrapper-inner"><span lang="en-GB">...</span></div> div[class|='wrapper']{/*...*/} span[lang|='en']{/*...*/}
^ =通常选择“子串匹配”,就像属性的第一个字母一样.