jQuery / DataTables:如何改变分页颜色(jQuery / DataTables: how to change pagination color)

编程入门 行业动态 更新时间:2024-10-25 16:22:51
jQuery / DataTables:如何改变分页颜色(jQuery / DataTables: how to change pagination color)

我正在使用jQuery DataTables插件(版本1.9.4),并希望更改分页的颜色。

使用CSS我可以改变他们的背景颜色,但我找不到改变锚标签的字体颜色和字体悬停颜色的方法。 我想将以下所有锚标签的字体颜色和悬停字体颜色都更改为白色(#FFFFFF)。

分页代码如下所示:

<div id="myTable_paginate" class="dataTables_paginate paging_full_numbers"> <a id="myTable_first" class="first paginate_button paginate_button_disabled" tabindex="0">First</a> <a id="myTable_previous" class="previous paginate_button paginate_button_disabled" tabindex="0">Previous</a> <span> <a class="paginate_active" tabindex="0">1</a> <a class="paginate_button" tabindex="0">2</a> </span> <a id="myTable_next" class="next paginate_button" tabindex="0">Next</a> <a id="myTable_last" class="last paginate_button" tabindex="0">Last</a> </div>

蒂姆,谢谢你对此有任何帮助。

I am using the jQuery DataTables plugin (version 1.9.4) and would like to change the color of the pagination.

With CSS I am able to change their background color but I couldnt find a way to change the font color and font hover color for the anchor tags. I would like to change both font color and hover font color for all the below anchor tags to white (#FFFFFF).

The pagination code looks as follows:

<div id="myTable_paginate" class="dataTables_paginate paging_full_numbers"> <a id="myTable_first" class="first paginate_button paginate_button_disabled" tabindex="0">First</a> <a id="myTable_previous" class="previous paginate_button paginate_button_disabled" tabindex="0">Previous</a> <span> <a class="paginate_active" tabindex="0">1</a> <a class="paginate_button" tabindex="0">2</a> </span> <a id="myTable_next" class="next paginate_button" tabindex="0">Next</a> <a id="myTable_last" class="last paginate_button" tabindex="0">Last</a> </div>

Thanks for any help with this, Tim.

最满意答案

也许你错过了!important声明? 在这种情况下,它确实很重要。

.paging_full_numbers a.paginate_button {
    color: #fff !important;
}
.paging_full_numbers a.paginate_active {
    color: #fff !important;
}
 

jsfiddle - > http://jsfiddle.net/CrBkT/

Maybe you miss the !important declaration? In this case it is indeed important.

.paging_full_numbers a.paginate_button {
    color: #fff !important;
}
.paging_full_numbers a.paginate_active {
    color: #fff !important;
}
 

jsfiddle -> http://jsfiddle.net/CrBkT/

更多推荐

本文发布于:2023-08-04 21:04:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1421987.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:分页   颜色   DataTables   jQuery   pagination

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!