Width Height and Orientation Queries
Target specific viewport dimensions and device orientations with media features.
width Media Feature
The width feature targets the viewport width. Use min-width and max-width to define ranges.
@media (min-width: 768px) {
/* 768px and wider */
}height Media Feature
The height feature targets the viewport height. Useful for short viewports (like landscape phones) where vertical space is limited.
@media (min-height: 600px) {
.hero { min-height: 80vh; }
}All lessons in this course
- Syntax and Common Breakpoints
- Width Height and Orientation Queries
- Prefers-Color-Scheme and Prefers-Reduced-Motion
- Combining Multiple Media Queries