Is it possible to select the nth-child of its grandparent element (2nd parent), versus it's parent element? I researched and apparently there are no CSS parent selectors.
My source code is located at http://dev.brickimedia.org/wiki/User:Codyn329/Sandbox/4
I want to do this so I can highlight the current day out of all the days on the calendar. However, since the way I nested it..
<div class="calendar-all-days">
<div class="calendar-week">
<div class="calendar-day">
When I select the parent of .calendar-day
, it goes to .calendar-week
instead of .calendar-all-days
.
The main CSS block I'm trying to use to do this is here (Note - I'm using a magic word in a parser function (#css from Extension:CSS) so direct input of {{CURRENTDAY}}
in the parentheses should be OK I assume):
.calendar-day:nth-child({{CURRENTDAY}}) {
background: #27ae60;
color: #fff;
font-weight: bold;
}