Anyone know what the purpose of tagging a class wi

2020-05-06 10:50发布

问题:

I received a file from a client today that is a template for an e-mail and in the css for the mobile version all of the class specifications were preceded with *[class]

e.g.

*[class].centertext {
somespec:0;
}

anyone know what the purpose of adding that to a class is?

thanks.

回答1:

There is a yahoo fix/bug workaround that uses this technique (css classes) in html email design. There was a bug where Yahoo rendered all media queries by default, and this was the common solution.

There have been reports that Yahoo fixed the bug recently.



回答2:

The square brackets are attribute selectors and the '*' is a wild card, so your client is selecting every element that has the class attribute.