jQuery UI datepicker:如何颜色星期日红色? [英] jQuery UI datepicker: How to color sundays red?
问题描述
我需要星期几以红色突出显示。
我知道有一个叫 ui-datepicker-week-end
。
我的问题是,其他类( ui-widget-content
和 ui-state-default
)覆盖 ui-datepicker-week-end
的红色,即使设置!important
。
唯一着色的是日历标题中的周末日。
您可以为 .ui-datepicker-week-end
元素,并在添加背景颜色时将其 background-image
属性设置为 none
。这样就可以得到很好的效果,而不必使用!重要的
:
。 ui-datepicker-week-end a {
background-image:none;
背景颜色:红色;
}
编辑:如果要设置 color
属性而不是 background-color
,您确实必须使用!important
:
.ui-datepicker-week-end a {
color:red!
}
您可以在这个小提琴。
i need sundays to highlight in red.
I know that there is a class called ui-datepicker-week-end
.
My problem is, that the other classes (ui-widget-content
and ui-state-default
) overwrite the red color of ui-datepicker-week-end
, even if set !important
.
The only thing that is colored are the weekend days in the headline of the calendar.
You can style the anchors that are descendants of the .ui-datepicker-week-end
elements, and set their background-image
property to none
when adding the background color. This gives good results without you having to use !important
:
.ui-datepicker-week-end a {
background-image: none;
background-color: red;
}
EDIT: If you want to set the color
property instead of background-color
, you will indeed have to use !important
:
.ui-datepicker-week-end a {
color: red !important;
}
You can see the results in this fiddle.
这篇关于jQuery UI datepicker:如何颜色星期日红色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!