首页 > 解决方案 > 周一到周日自动突出显示工作日单元格。今天是星期二我想突出显示星期二,见附图

问题描述

请看下图,我希望每天自动突出显示图书馆时间。

https://i.stack.imgur.com/LvqhR.png

标签: htmlcss

解决方案


You could use JavaScript for that.

var date = new Date();
var day = date.getDay(); //Returns 0-6 (sunday-saturday)

You can now add a highlighter class to the current day div depending on the day variable.


推荐阅读