CSS Tutorial

The language for styling web pages.

CSS Media Queries

CSS Media Queries

Media queries are used to apply CSS styles depending on a devices general type (such as print vs. screen) or specific characteristics (such as browser viewport width).

Syntax:

@media (condition) { CSS rules }

Common Breakpoints:

  • max-width: 576px - Mobile phones
  • max-width: 768px - Tablets
  • max-width: 992px - Small laptops
  • max-width: 1200px - Large screens

Try It Yourself

Edit the code below and click Run to see the result live.

Source Code
Result
Topics