The screen media type targets on-screen displays. It is the default for web browsers and the foundation of every responsive layout you build with media queries.
01
@media
Media query.
02
screen
On-screen.
03
min-width
Desktop up.
04
max-width
Mobile down.
05
vs print
Screen/paper.
06
default
Optional.
Fundamentals
Introduction
When you open a website on your phone or laptop, the browser renders it on a screen — a continuous, scrollable display. CSS media queries let you target that medium specifically with @media screen.
Most responsive CSS you write already applies to screens. Adding the screen keyword makes that intent explicit and helps separate on-screen styles from print or other output types.
Definition and Usage
Write @media screen and (max-width: 600px) to apply rules only on screens 600 pixels wide or narrower. Combine with any media feature: min-width, orientation, resolution, and more.
💡
Beginner Tip
In everyday web development, @media (max-width: 768px) works the same as @media screen and (max-width: 768px) because browsers assume screen by default. Use screen explicitly when you also write @media print rules.
Foundation
📝 Syntax
Use screen as the media type, then add features with and:
syntax.css
/* All screen devices */@mediascreen{/* On-screen styles */}/* Screens 600px wide or narrower */@mediascreenand(max-width:600px){/* Mobile screen styles */}/* Wide screens (desktop) */@mediascreenand(min-width:48rem){/* Desktop screen styles */}
There is no default media query. However, browsers treat normal stylesheets as screen media by default. Rules outside any @media block already apply to on-screen display.
Syntax Rules
Combine type and feature with and: @media screen and (min-width: 48rem).
Use commas for OR logic: @media screen and (max-width: 600px), print { }.
Do not call screen a CSS property — it is a media type.
Prefer rem or em for breakpoints when possible; px is fine for learning.
Pair screen rules with print rules when content appears in both mediums.
Understanding screen means knowing what isn’t screen. Hiding UI chrome with @media print keeps printed articles clean.
Tips
🛠 Usage Tips
Mobile-first — Start with base styles, add screen and (min-width: …) for larger screens.
Explicit with print — When you have print styles, write screen on screen-only rules for clarity.
Use rem breakpoints — 48rem scales with user font-size preferences better than fixed pixels.
Test by resizing — Drag the browser window to verify max-width breakpoints.
Combine features — screen and (min-width: 48rem) and (orientation: landscape) for precise targeting.
Watch Out
⚠️ Common Pitfalls
Calling it a property — screen is a media type, not a CSS property.
Missing and — Write @media screen and (max-width: 600px), not @media screen (max-width: 600px).
Confusing type with feature — screen is the medium; min-width is the condition.
Only max-width — Don’t forget min-width for desktop-first enhancements.
Forgetting print — Screen-only banners and dark backgrounds may waste ink when printed.
A11y
♿ Accessibility
Zoom-friendly breakpoints — Use relative units so layouts adapt when users zoom text.
Do not hide content — Responsive breakpoints should reflow content, not remove essential information.
Touch targets on small screens — Screen mobile styles need large enough buttons and links.
Contrast on all sizes — Color changes at breakpoints must maintain readable contrast.
Motion preferences — Combine screen queries with prefers-reduced-motion for animations.
🧠 How screen Works
1
Browser detects output medium
Identifies whether content renders on a screen or is being printed.
Detect
2
screen type is matched
Rules inside @media screen qualify for on-screen display.
Match
3
Media features are evaluated
Width, orientation, and other conditions are checked with and.
Evaluate
=
💻
Responsive on every screen
Layout adapts to viewport size on phones, tablets, and desktops.
Compatibility
🖥 Browser Compatibility
The screen media type is supported in all browsers. It has been a core part of CSS since media queries were introduced.
✓ Baseline · Universal support
Screen media queries
Works in Chrome, Firefox, Safari, Edge, Opera, and all mobile browsers.
100%Global support
screen media type100% supported
Bottom line:@media screen is production-ready and the backbone of responsive web design.
Wrap Up
🎉 Conclusion
The screen media type targets on-screen displays — the medium where nearly all web browsing happens. Combine it with min-width, max-width, and other features to build responsive layouts that adapt from phones to desktops.
Browsers default to screen, so the keyword is often optional. Use it explicitly when you also style for print and want clear, maintainable separation between screen and paper output.
Use these points when building responsive on-screen layouts.
5
Core concepts
scr01
screen
Media type.
Type
def02
Default
In browsers.
Behavior
and03
and (width)
Combine.
Syntax
prt04
vs print
Screen/paper.
Compare
%05
100%
Supported.
Support
FAQ
❓ Frequently Asked Questions
What does the CSS screen media type do?
The screen media type targets continuous on-screen presentation — monitors, laptops, tablets, and phones. Rules inside @media screen { } apply when content is displayed on a screen, not when printed.
Is screen a media type or a media feature?
screen is a media type — it describes the output medium (a display). Features like min-width, orientation, and resolution describe device capabilities. Combine them: @media screen and (max-width: 600px) { }.
Do I need to write screen in every media query?
Usually no. Browsers default to screen for normal stylesheets. @media (max-width: 768px) behaves the same as @media screen and (max-width: 768px) on the web. Use screen explicitly when you want to separate screen rules from print or other media types.
How do I build responsive layouts with screen?
Combine screen with width features: @media screen and (min-width: 48rem) for desktop, @media screen and (max-width: 37.5rem) for mobile. Mobile-first designs often use min-width breakpoints that layer styles as the viewport grows.
Is @media screen widely supported in browsers?
Yes. The screen media type has been supported in all browsers for decades. It is the foundation of responsive web design alongside width-based media features.