CSS Media Query Generator
Generate CSS media queries instantly with custom breakpoints, screen sizes, orientations, and responsive conditions. Preview layouts, customize CSS, and copy or download responsive code directly in your browser.
Media Query Settings
Presets fill the relevant breakpoint field. Choose breakpoints based on where your layout actually breaks, not on device names.
Orientation reflects the viewport's width-to-height relationship, not a guaranteed physical device orientation.
Advanced Media Features
Nonnegative integer for the color media feature.
Some media features describe user-agent or device capabilities rather than viewport size. Not every browser or device implements every feature.
Generated CSS
AutoCSS Rules
Responsive Preview
—Preview uses browser rendering at the selected viewport size. Features such as hover, pointer, contrast preferences, print media, forced colors, and resolution may not be fully simulatable in an ordinary preview.
Query Information
Generated Query
—
Breakpoint Summary
—
Validation
No issues detected by the available checks.
Example Media Queries
Responsive Preview
', 'Viewport: —
', 'Sample Card
', 'This card demonstrates the effect of your media query at the selected viewport width.
', 'Example Button', 'Another Card
', 'Content inside a responsive container.
', 'Third Card
', 'Add more cards or sections to test more complex layouts.
', '