Why is this invulnerable to styling?

南笙酒味 提交于 2019-12-23 20:06:43

问题


I just want to change it's color to #DD4814 but I can't. It's a "share button" btw. What could be the reason?

<span class='st_sharethis' st_title='<?php the_title(); ?>' st_url='<?php the_permalink() ?>' displayText='Compartir'></span>

<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script><script type="text/javascript">stLight.options({publisher:'eb2f12b2-11c6-4013-bf2c-e42dcf3112f5'});</script>

回答1:


This works for me:

.stButton .sharethis {color:#DD4814}



回答2:


Usually styling won't work when one selector has precedence over the one you are using. This is called selector specificity and there is a lot of documentation to help you understand how it works.

Because of the nature of the problem, you probably haven't posted enough code to give you an exact answer. But, read the answer to this question: CSS problem - an element only works if its has no parent (using jquery) and http://htmldog.com/guides/cssadvanced/specificity/

To figure out how to apply the answer to your problem, use Firebug, right click on the element, and select "Inspect Element". On the right pane of Firebug should be the Style tab where it will show you which CSS selectors apply to that element. Find the one that has the style you can't overwrite, and make sure your selector is more specific than that.



来源:https://stackoverflow.com/questions/4434800/why-is-this-invulnerable-to-styling

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