Learn how to create websites that work well on all devices and screen sizes
Percentage (%)
Em
Rem
Viewport Width (vw)
Viewport Height (vh)
Viewport Minimum (vmin)
Viewport Maximum (vmax)
Small Mobile Devices
Medium Mobile Devices
Tablets
Desktops
Large Desktops
clamp()
function takes three values: a minimum size, a preferred size, and a maximum size. This ensures text is never too small or too large.
<picture>
element allows you to specify different image sources for different viewport sizes or device capabilities.
srcset
and sizes
attributes allow browsers to choose the most appropriate image based on the device’s characteristics.
srcset
: Available image files and their widthssizes
: How much space the image will take up at different viewport widthsChrome DevTools
Firefox Responsive Design Mode
Design for mobile first
Use relative units
Optimize images
Ensure touch-friendly interfaces
Maintain accessibility
Monitor performance
Test across browsers and devices
Not using the viewport meta tag
Using fixed widths
Forgetting touch users
Hiding content on mobile
Not testing on real devices
Container Queries
CSS Houdini
Responsive to User Preferences
Responsive Design for New Interfaces