简体   繁体   English

加载后更改字体颜色

[英]Change colour of font after loading

Is it possible to change the color of "View Results" text in below ? 是否可以在下面更改“查看结果”文本的颜色?

   <script type="text/javascript" charset="utf-8" src="http://static.polldaddy.com/p/6352993.js"></script>
    <noscript><a href="http://polldaddy.com/poll/6352993/">This is very long test question to test how polldaddy handles questions that exceed that normal length............ yes a very long question indeed..............</a></noscript>​

I've tried overriding the css 'pds-view-results' which is what "View Results" is styled with but no effect : 我尝试覆盖css'pds-view-results',这是“ View Results”样式的设置,但没有效果:

.pds-view-results {
    color: red;
}

Here is a fiddle : 这是一个小提琴:

http://jsfiddle.net/25LjE/36/ http://jsfiddle.net/25LjE/36/

Since the link color is already specified by a rule, you should override it via !important keyword 由于链接颜色已由规则指定,因此您应通过!important关键字覆盖它

.pds-view-results {
    color: red !important;
}

您可以通过javascript做到:

$('.pds-view-results').css('color', 'red');

You can also set your style late 您还可以设置你的style

That way you can avoid !important and javascript . 这样,您可以避免!importantjavascript But, I'll advice you to put only the last css rule like this, as it may cause flickering. 但是,我建议您仅放置最后一个CSS规则,因为这样可能会导致闪烁。 Try it, it may work for you. 试试看,它可能对您有用。

<script type="text/javascript" charset="utf-8" src="http://static.polldaddy.com/p/6352993.js"></script>
<noscript><a href="http://polldaddy.com/poll/6352993/">This is very long test question to test how polldaddy handles questions that exceed that normal length............ yes a very long question indeed..............</a></noscript>

<style type='text/css'>
    .pds-pd-link {
display: none !important;
}
.pds-box {
    width: 220px !important;
}
.pds-input-label{
    width: auto! important;
}
.PDS_Poll{
    margin-bottom:15px;
}
.pds-view-results {
    color: red;
}
#PDI_container6352993 .pds-links a{
  color:blue;
}
</style>​

http://jsfiddle.net/nXS4J/ http://jsfiddle.net/nXS4J/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM