CSS Selector [attribute*=value]

Description

The [attribute*=value] selector selects every element whose attribute contains the value.

Example


<!DOCTYPE html>
<html>
<head>
<style> 
div[class*="myStyle"]{
   background:red;
}<!--from w  w  w  .ja  v a  2 s.c om-->
</style>
</head>
<body>
   <div class="myStyle">div element.</div>
   <p class="myStyle">paragraph.</div>
</body>
</html>

Click to view the demo

The code above generates the following result.

[attribute*=value]




















Home »
  HTML CSS »
    HTML CSS Reference »




HTML Tag Reference
CSS Reference
CSS Selector Reference
Encoding Reference