0

是否可以更改下面“查看结果”文本的颜色?

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

我试过覆盖css'pds-view-results',这是“查看结果”的样式,但没有效果:

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

这是一个小提琴:

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

4

3 回答 3

5

由于链接颜色已经由规则指定,您应该通过!important关键字覆盖它

.pds-view-results {
    color: red !important;
}
于 2012-07-05T11:10:59.050 回答
1

你可以从 javascript 做到这一点:

$('.pds-view-results').css('color', 'red');
于 2012-07-05T11:12:44.407 回答
1

你也可以设置你的style 迟到

这样你就可以避免!importantand javascript。但是,我建议你只放置最后一个这样的 CSS 规则,因为它可能会导致闪烁。试试看,它可能对你有用。

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

于 2012-07-05T11:27:25.017 回答