CSS Tutorial

CSS Style

CSS Layout Style

CSS Float Style

CSS Reference

CSS element[attr*=value] Selector


What is [att*=value] Selector?

CSS [att*=value] selector matches all elements whose attribute value contain at least one substring value string.

Browser Compatibility

  • Google Chrome 2+
  • Mozilla Firefox 3+
  • Internet Explorer 9+
  • Opera 9.5+
  • Safari 1.3+

Note: Here details of browser compatibility with version number may be this is bug and not supported. But recommended to always use latest Web browser.

Syntax

This is general syntax,

[attr*=value] {
	property: value;
	property: value;
	...
}

Example:

Select every element whose attribute value contain at least one substring dem string to apply CSS style.

<style type="text/css">
a[class*=demo] {
    background:yellow;
}
</style>
</head>
<body>
    <a class="subdemo_one" href="#">English International</a><br />
    <a class="subdem" href="#">English US</a><br />
    <a class="subdemos" href="#">Google</a><br />
</body>

Run it...   »

Example Result: