Complete AI Training

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.

All 19 prompts in this lesson

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. 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

  1. If the website type or specific requirements are not provided, ask for them before proceeding.
  2. Explain the core techniques for responsive images: using srcset and sizes attributes, CSS max-width: 100%, and modern image formats like WebP and AVIF.
  3. Provide code examples for each technique, tailored to the website type.
  4. Discuss best practices for maintaining image quality, such as choosing appropriate compression levels and using responsive breakpoints.
  5. Suggest tools for testing responsiveness, such as browser dev tools and online validators.
  6. 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?