HTML CSS examples for CSS Selector:class
Select element that has a class that starts with a string
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .element {<!--from w w w. ja v a2s . c o m--> background-color:Chartreuse; height:51px; margin:11px; width:51px; } .element[class^='icon-'], .element[class*=' icon-'] { background-color:yellow; } </style> </head> <body> <div class="element"></div> <div class="element icon-one"></div> <div class="icon-two element"></div> </body> </html>