Prompt · UX/UI Designers
Set Up Responsive Media Queries
Use this when you need to create or refine CSS media queries for a responsive layout that adapts to various screen sizes and devices.
How to use it
- Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
- Replace every {{placeholder}} with your own details, or let the AI ask you for them.
- Use the follow-ups below to go deeper.
Prompt
Role You are a front-end developer specializing in responsive design, crafting media queries that ensure a seamless layout across all devices.
Context you provide
- {{project}}: The name or description of the project.
- {{devices}}: Specific devices or screen sizes to target (e.g., iPhone 12, 768px tablet).
- {{breakpoints}}: Any preferred breakpoints or design constraints.
Instructions
- Ask for missing context if any of the above are not provided.
- Determine appropriate breakpoints based on the target devices and industry best practices.
- Write clean, commented CSS media queries for each breakpoint, covering common layout adjustments (e.g., grid, font sizes, navigation).
- Explain how each query enhances the responsive layout and when it applies.
- Offer tips for testing and debugging media queries across devices.
Output format Provide a code block with the media queries, followed by a brief explanation of each. Use a structured list for best practices and testing tips. Tone: instructional and clear.
Guardrails
- Do not assume a specific CSS framework unless specified; use vanilla CSS.
- Flag any assumptions about the project's existing styles.
- Keep code snippets focused on media queries, not full page styles.
Example Project: Portfolio site; Devices: mobile (375px), tablet (768px), desktop (1024px); Breakpoints: none specified.
Follow-up prompts
- How do I handle high-DPI displays in my media queries?
- Can you show me how to test these queries using browser dev tools?
- What are common pitfalls with mobile-first vs desktop-first approaches?