Media query

noun

say it: “MEE-dee-uh KWEER-ee” /ˈmiːdiə ˈkwɪri/

A CSS rule that applies its styles only when a condition about the screen or device is true, such as "the window is at least 40rem wide".

What is a media query?

A media query applies CSS only when a condition is true, most often "when the screen is at least this wide".

@media (min-width: 768px) {
  .products { grid-template-columns: repeat(3, 1fr); }
}

In a sentence

  • “I wrapped the three-column menu in a media query so phones keep the single column.”

Level: Journeyman · More CSS terms at this level

Updated