Uta Guide

Lesson: Responsive Design

Make your web page look amazing on any device!

๐Ÿ“ฑ What is Responsive Design?

Responsive design allows your website to adapt to different screen sizes โ€” phones, tablets, desktops โ€” using flexible layouts and media queries.

๐Ÿง  Media Query Basics

@media (max-width: 768px) {
  body {
    background: lightblue;
  }
}

This changes the background only on small screens (768px or less).

๐Ÿ’ก Common Breakpoints

๐Ÿงช Example: Responsive Grid

<div class="grid">
  <div class="card">Card 1</div>
  <div class="card">Card 2</div>
  <div class="card">Card 3</div>
</div>
.grid {
  display: grid;
  gap: 16px;
}
.card {
  background: #f0f0f0;
  padding: 20px;
}
@media (min-width: 768px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 992px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

Responsive layout that adapts to screen size!

โœ… Best Practices

๐Ÿš€ Try It Yourself!

Open Responsive Playground
PREVIOUS LESSON :

Pseudo-Selectors

NEXT LESSON :

Hover Effects & Transitions