在jquery datepicker中更改周末日期的字体颜色

问题描述 投票:5回答:1

是否可以在jquery日历中更改周末日期的字体颜色?我尝试使用类ui-datepicker-week-end,但它只改变了Sun和Sat的字体颜色。我想要的是改变落在太阳和坐着的日子的颜色。

jquery html css jquery-ui jquery-ui-datepicker
1个回答
7
投票

你的选择器需要更多的特异性,因为ui-datepicker-week-end<td>上,但是里面有<a>ui-state-default,如下所示:

.ui-datepicker-week-end, .ui-datepicker-week-end a.ui-state-default {color:red;}

You can test it here。如果你很好奇,日间单元格的标记是这样的:

<td class="ui-datepicker-week-end">
  <a class="ui-state-default" href="#">DAY NUMBER</a>
</td>
© www.soinside.com 2019 - 2024. All rights reserved.