vendredi 11 septembre 2015

Select all span elements except those which class contains the word icon

I'm implementing the following CSS Selector

Select all span elements except those which class contains the word icon

So the following seems to be working:

.music-site-refresh span:not([class*="icon-"]) {
  font-family:Montserrat, sans-serif;
}

But I thought it should be like this:

.music-site-refresh span:not(span[class*="icon-"]) {
  font-family:Montserrat, sans-serif;
}

But the second one doesn't work in my testbed.

Could anyone explain me which one is correct and why?

Here is some barfed html for example purposes:

<span class="cmImageSliderIndicatorActive icon-circle-blank" data-set="0"></span>

<div class="janrain-share-providerslist-provider-image janrain-provider-icon-grayscale-email"></div>

There are more icons. It is not an icon class, that is why I'm using class*



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire