根据交替行更改FullCalendar 5.7的颜色 - nth-Child的哪个元素?
有关于此的帖子。我已经这样做了:(
.fc table tr td:nth-child(odd) {
border-collapse: collapse;
border-spacing: 0;
background: rgba(240,240,247,1);
font-size: 1em
}
也尝试了.fc-scrollgrid-都一样),
但由于TR在工作日之前,这给出了交替列而不是行的两种颜色。
因此,一篇文章(从5年前开始)表明
.fc-day-grid > div.fc-row:nth-of-type(even) {
background: #CCC;
}
:
另外,您需要定位代表的一系列元素 排 - 它们不是桌子。他们在桌子里,有 其中更多的表,但行本身实际上是
< div>
s (当您检查日历的渲染html时,您可以看到这一点 使用您的浏览器工具)。
但是,当我在浏览器中查看浏览器中的这些事件时,我在那里看不到任何divs。我不知道要定位哪个要素才能使此元素起作用。
我正在尝试将其应用于Fullcalendar 5.7的“ Daygridmonth”(Daygridmonth)5.7
有什么想法吗? - 谢谢
There have been posts on this. I have done this:
.fc table tr td:nth-child(odd) {
border-collapse: collapse;
border-spacing: 0;
background: rgba(240,240,247,1);
font-size: 1em
}
(also tried with .fc-scrollgrid -- all the same)
but that gives the 2 colors on alternating columns, not rows, since the tr's go by weekday.
So one post (from 5 years ago) which suggests
.fc-day-grid > div.fc-row:nth-of-type(even) {
background: #CCC;
}
says:
Also, you need to target the series of elements which represent
the rows - they are not a table. They're inside a table, and there are
more tables inside them, but the rows themselves are actually<div>
s
(you can see this when you inspect the rendered HTML of the calendar
using your browser tools).
But when I look in the browser at these events in the browser, I don't see any divs in there. I don't know which element to target to get this to work.
I am trying to apply this to the month view (dayGridMonth) in fullCalendar 5.7
Any ideas? -- Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在FullCalendar 5.x中的DayGridMonth视图中,网格中的每一行都具有以下html:
它们在
&lt; tbody prole =“呈现”&gt;
table body元素(以将它们与其他区分开来&lt; tr&gt;
,例如具有相同行的列标题行)。通过使用浏览器的元素检查器工具查看日历生成的HTML,可以看到这一点。
因此,您可以用CSS规则将交替行定位为类似的内容:
demo: https://codepen.io noreferrer /adyson82/pen/mdxjypp
In the dayGridMonth view in fullCalendar 5.x, each row in the grid has the following HTML:
These are within a
<tbody role="presentation">
table body element (to distinguish them from other<tr>
s such as the column heading row, which have the same row).This can be seen by looking at the calendar's generated HTML using a browser's element inspector tool.
So you can target the alternating rows with a CSS rule something like this:
Demo: https://codepen.io/ADyson82/pen/mdxJYpp