Make your web page look amazing on any device!
Responsive design allows your website to adapt to different screen sizes โ phones, tablets, desktops โ using flexible layouts and media queries.
@media (max-width: 768px) {
body {
background: lightblue;
}
}
This changes the background only on small screens (768px or less).
max-width: 575.98px
min-width: 768px
min-width: 992px
<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!
vw
/em
units instead of fixed pixelsmax-width
and min-width
to control design shifts