Media query to filter css rules based on current month

We often get the task of changing the background in certain seasons.

Does anyone know if something like creating a query @mediabased on a month is possible ?

Like this

@media(min-month:11) and (max-month:1)
{
  body
  {
    background: url("snowy.png") center top;
    background-size: cover;
  }
}
+4
source share
1 answer

Date and time information is unlikely to ever be supported as a media query. Media queries are designed to apply a conditional style based on the properties of the output device (or "medium"), such as the width of the device or whether the content is printed. Supported types can be found in the W3C documentation and should give you an idea of ​​the intentions associated with media queries.

( , ) (, JavaScript), , .

+2

Source: https://habr.com/ru/post/1613497/


All Articles