Shaiful Islam Shaiful Islam - 1 year ago 68
CSS Question

How to do CSS wild card search?

I have three

with following class:

<div class="page-search-site health-bundle-medical-group">Some text here</div>
<div class="health-bundle-clinic">Some text here 2</div>
<div class="page-search-site health-bundle-hospital">Some text here 3</div>

text is common for all three classes. So I want to write a CSS which will work for all these three classes, which will work if it matches the common part. Is it possible?

Answer Source

What you need is called attribute selector. An example, using your html structure, is the following:[class*='-bundle-medical-group']  {

In the place of div you can add any element or remove it altogether, and in the place of class you can add any attribute of the specified element.[class*='-bundle-medical-group'][class*='-bundle-hospital'][class*='-bundle-clinic']


More information on CSS attribute selectors, you can find here and here.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download