This page is part of the CSS3.info CSS selectors test. See more info on CSS3 selectors.
div[lang|=en] {
}
<div lang='en'></div>
The CSS selector should match the HTML fragment because the attribute is an exact match
div[lang|=en] {
}
<div lang='EN'></div>
The CSS selector should match the HTML fragment because the value of the lang attribute should be case insensitive in a HTML document
div[lang|=en] {
}
<div LANG='en'></div>
The CSS selector should match the HTML fragment because the case of the attribute name should not matter in a HTML document
div[lang|=en] {
}
<div lang='en-US'></div>
The CSS selector should match the HTML fragment because the value before the hyphen is an exact match
div[lang|=en] {
}
<div lang='en-Nonsense'></div>
The CSS selector should match the HTML fragment because the value before the hyphen is an exact match
div[lang|=en] {
}
<div></div>
The CSS selector should not match the HTML fragment because the attribute is not present
div[lang|=en] {
}
<p lang='en'><div></div></p>
The CSS selector should not match the HTML fragment because the attribute is not present and it should not match inherited properties
div[lang|=en] {
}
<div lang=''></div>
The CSS selector should not match the HTML fragment because the attribute is empty
div[lang|=en] {
}
<div lang='nl'></div>
The CSS selector should not match the HTML fragment because the attribute does not contain the correct value
div[lang|=en] {
}
<div lang='english'></div>
The CSS selector should not match the HTML fragment because the attribute does not contain the correct value
div[lang|=en] {
}
<div lang='nl-en'></div>
The CSS selector should not match the HTML fragment because the part before the hyphen is not an exact match
div[lang |= en] {
}
<div lang='en'></div>
The CSS selector should match the HTML fragment because the attribute is an exact match
div[lang |=en] {
}
<div lang='en'></div>
The CSS selector should match the HTML fragment because the attribute is an exact match
div[lang|= en] {
}
<div lang='en'></div>
The CSS selector should match the HTML fragment because the attribute is an exact match
div[title|=match] {
}
<div title='match'></div>
The CSS selector should match the HTML fragment because the value of the title attribute is an exact match
div[title|=match] {
}
<div title='MATCH'></div>
The CSS selector should not match the HTML fragment because value of the title attribute should be compared in a case-sensitive way
div[id|=match] {
}
<div id='MATCH'></div>
The CSS selector should not match the HTML fragment because value of the id attribute should be compared in a case-sensitive way
label[for|=match] {
}
<label for='MATCH'></label>
The CSS selector should not match the HTML fragment because value of the for attribute should be compared in a case-sensitive way
div[lang|=en] {
}
<div lang=' en '></div>
The CSS selector should not match the HTML fragment because the attribute does not contain the correct value - it is not allowed to strip whitespace in HTML documents