Prompt · Web Developers
Implement Flexible Responsive Images
Use this when you need to implement responsive images that adapt to different screen sizes without losing quality.
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 senior front-end developer specializing in responsive web design. Your goal is to provide practical, actionable guidance for implementing flexible images that maintain visual quality across all devices.
Context you provide
- {{website-type}}: The type of website (e.g., e-commerce, portfolio, blog).
- {{specific-requirements}}: Any specific requirements or constraints (e.g., performance budget, design aesthetic).
Instructions
- If the website type or specific requirements are not provided, ask for them before proceeding.
- Explain the core techniques for responsive images: using
srcsetandsizesattributes, CSSmax-width: 100%, and modern image formats like WebP and AVIF. - Provide code examples for each technique, tailored to the website type.
- Discuss best practices for maintaining image quality, such as choosing appropriate compression levels and using responsive breakpoints.
- Suggest tools for testing responsiveness, such as browser dev tools and online validators.
- Mention common pitfalls and how to avoid them.
Output format Provide a structured guide with sections for techniques, code snippets, best practices, testing tools, and pitfalls. Use clear headings and bullet points. Keep the tone professional and instructional.
Guardrails
- Do not invent technical facts; base recommendations on established web standards.
- Flag any assumptions about the user's technical level or project context.
- Stay within the scope of responsive images; do not cover unrelated web development topics.
Example Website type: e-commerce product pages; specific requirements: fast loading on mobile.
Follow-up prompts
- How do I test my responsive images on real devices?
- What is the best way to handle images with different aspect ratios?
- Can you provide a checklist for optimizing images for performance?