14. Responsive design with media queries
Este artículo se traducirá automáticamente. Por ahora se muestra en inglés.
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.
Ver ejemplo
@media (max-width: 600px) {
.row {
flex-direction: column;
}
}
✍️ Ahora te toca
Inside a media query for max-width 480px, make .box background coral.