Starlit Daily

📚 › CSS: style and layout

14. Responsive design with media queries

ستتم ترجمة هذا المقال تلقائيًا. يُعرض بالإنجليزية حاليًا.

Phones and laptops have different widths. A media query applies rules only when a condition is true. @media (max-width: 600px) { ... } applies the rules inside only on narrow screens.

Design for small screens first, then add rules for wider ones. That keeps the page usable everywhere.

عرض المثال

@media (max-width: 600px) {
  .row {
    flex-direction: column;
  }
}

✍️ دورك الآن

Inside a media query for max-width 480px, make .box background coral.

← العودة إلى الدورة