Forum Moderators: not2easy
Attribute selectors are enabled only in standards-compliant mode (strict!DOCTYPE).
Attributes are case-sensitive.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Test</title>
<style type="text/css">
[for],[class] { background: green; }
</style>
</head>
<body>
<label for="foo">test</label>
<label class="foo">test</label>
</body>
</html> (yeah, I know, I ought to revise it to HTML over XHTML. Does the job currently though)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Test</title>
<style type="text/css">
[for], [class], [if], [while] { background: green; }
[fee] { background: green; }
[id] { background: green;}
</style>
</head>
<body>
<label fee="foo">test</label>
<label while="foo">test</label>
<label for="foo">test</label>
<label if="foo">test</label>
<label class="foo">test</label>
<label id="foo">test</label>
</body>
</html>