为什么它对造型无懈可击?

发布于 2024-10-07 14:20:31 字数 453 浏览 0 评论 0原文

我只想将其颜色更改为#DD4814,但我不能。顺便说一句,这是一个“分享按钮”。 可能是什么原因?

<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>

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>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

我很坚强 2024-10-14 14:20:31

这对我有用:

.stButton .sharethis {color:#DD4814}

This works for me:

.stButton .sharethis {color:#DD4814}
你列表最软的妹 2024-10-14 14:20:31

通常,当一个选择器优先于您正在使用的选择器时,样式将不起作用。这称为选择器特异性,有很多文档可以帮助您了解它的工作原理。

由于问题的性质,您可能没有发布足够的代码来给您准确的答案。但是,请阅读此问题的答案: CSS 问题 - 元素仅在没有父元素(使用 jquery)时才有效http://htmldog.com/guides/cssadvanced/specificity/

要了解如何将答案应用于您的问题,请使用 Firebug,右键单击该元素,然后选择“检查元素” 。 Firebug 的右侧窗格应该是“样式”选项卡,它将向您显示哪些 CSS 选择器适用于该元素。找到具有您无法覆盖的样式的选择器,并确保您的选择器比该选择器更具体。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文