为html5本机datepicker设置日历 [英] Styling the calendar for html5 native datepicker

查看:154
本文介绍了为html5本机datepicker设置日历的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以为默认的html5 datepicker更改日历popover的样式?

Is it possible to change the styling for the calendar popover for the default html5 datepicker?

我想将月份的导航按钮移动到日历下方,并更改字体样式,大小,颜色等。我知道您可以从此stackoverflow线程更改输入框( HTML5日期选择器是否有任何样式选项?),但是我想更改日历本身的样式。有没有一个简单的方法呢?

I want to move the navigation buttons for the month to below the calendar, and change the font-style, size, colors, etc. I'm aware you can change the input box from this stackoverflow thread (Are there any style options for the HTML5 Date picker?), but I want to change the styling of the calendar itself. Is there a easy way of doing this?

推荐答案

我不认为自己每次都有跨浏览器的样式浏览器实现自己的日历不同。最简单的方法(如果可以使用外部库)只是使用 jQuery UI Datepicker ,而不需要样式给你一个基本的日历弹出窗口,然后您可以使用CSS自定义样式/定位。如果您需要帮助,请通知我。

I don't think there's any cross-browser way of styling it since every browser implements their own calendar differently. The easiest way (if you can use external libraries) is to just use jQuery UI Datepicker, which without styling will just give you a basic calendar popover that you can then customize the styling/positioning with CSS. Let me know if you need help with that.

然后,您可以使用本机html5 datepicker / calendar作为禁用javascript的浏览器的回退。

You can then use the native html5 datepicker/calendar as a fallback for browsers that have javascript disabled

这篇关于为html5本机datepicker设置日历的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆