Anyone know what the purpose of tagging a class with *[class]

霸气de小男生 提交于 2019-12-20 06:14:29

问题


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.



来源:https://stackoverflow.com/questions/18877503/anyone-know-what-the-purpose-of-tagging-a-class-with-class

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!