css 解释 html 时间对象

标签 css object time

css 是否能够解释 html 时间对象? 更具体:是否可以为包含过去日期的时间对象定义显示规则?

我的网站提供了一个乐队的演出列表。由于列表很长,将所有过去的表现“灰色化”会很有帮助。

这个应该是灰色的....

<time datetime="2018-09-08">
    08.09.2018: Last night of the proms - Royal Albert Hall - Starttime: 20:00
</time>

这个还是……呃蓝色!

<time datetime="2018-12-31">
    31.12.2018: The Blitz Party - Village Underground - Starttime: 22:00
</time>

最佳答案

检查一下。 JS Fiddle 预览 https://jsfiddle.net/itsselvam/8z5kja7w/

time{display:block; clear:both; margin:10px;}

time[datetime="2018-09-08"] {border:1px solid grey; color:grey; padding:4px; border-radius:4px}

time[datetime="2018-12-31"] {border:1px solid blue; color:blue; padding:4px; border-radius:4px}
<time datetime="2018-09-08">
    08.09.2018: Last night of the proms - Royal Albert Hall - Starttime: 20:00
</time>

<time datetime="2018-12-31">
    31.12.2018: The Blitz Party - Village Underground - Starttime: 22:00
</time>

关于css 解释 html 时间对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53650064/

相关文章:

random - 如何在JMeter中的页面请求之间添加不同的时间延迟?

html - 带有媒体查询的水平滚动条问题

css - 如何在 primefaces 中更改鼠标悬停时的命令链接图像?

html - 输入字段不必要的属性正在接受 IOS 设备

objective-c - Objective C 在栈上分配对象

Boost:如何从 Epoch 以毫秒为单位打印/转换 posix_time::ptime?

php - 为什么这个查询异常长?

javascript - CSS:如果 p 的高度覆盖,则增加父宽度

javascript - 循环访问对象时出错

javascript - Javascript-对象数组未按日期排序