CSS Class Contains

Glenn Glenn's Blog 0 Comments

Sometime you have classes like ‘myclass-1″ “myclass-2” and this may often be the case if you are using a WordPress plugin that spews out multiple divs with class names that are incrementally different. That can be a real pain, but thanklsfully you can still target them with a single line of CSS using the ‘CSS3 [attribute*=value] Selector’. Here’s the css:-

[css]
[class*="part-of-class"]{
color: red;
}
[/css]

In the example above any class containing the syntax “part-of-class” will have red text. It’s so simple and also supported on all major browsers.

About the Author
CSS Class Contains CSS Class Contains 0da77002febbfe28d15144a57bbcc2c9 s 180 d mm r g

Glenn

A highly experienced WordPress Web Developer, Front-end and Back-end Developer & New Media Specialist with extensive knowledge of a wide spectrum of technologies in the Development and Creative Industries built up over a number of years.

Leave a Reply

Your email address will not be published. Required fields are marked *