GPT 5 Available DeepSeek V4 Available Kimi K2.6 Available GPT 5 Mini Available DeepSeek V3.2 Available GPT 5.4 Available GPT 5.4 mini Available Grok 4 Available Llama 3.1 Available Phi 4 Available GLM 5.2 by Z.ai Available Claude Haiku 5.5 Available
Free AI chat models, no sign upSee all chat models →
Buy me a coffee
GPT 5 Available DeepSeek V4 Available Kimi K2.6 Available GPT 5 Mini Available DeepSeek V3.2 Available GPT 5.4 Available GPT 5.4 mini Available Grok 4 Available Llama 3.1 Available Phi 4 Available GLM 5.2 by Z.ai Available Claude Haiku 5.5 Available
Free AI chat models, no sign upSee all chat models →
Free AI Responsive Design Generator

Responsive Generator

Create mobile-first HTML and CSS for a navbar, a card grid or a hero section for free with AIFreeForever's AI Responsive Generator. Each design comes with breakpoints, flexible units and a live preview.

Pick the responsive approach and CSS units to generate your responsive codePick the approach and units
Responsive Approach
CSS Units
Describe the layout needed
Quick responsive approaches you can choose from

What is AI Responsive Design Generator

Centered hero graphic with the title Ai Responsive Generator in soft-shadow AI-inspired typography above a sleek UI panel showing a layout width input, device type dropdown, adaptive breakpoints toggle, and Generate button, with subtle responsive design workflow visuals in the background.

This tool generates mobile-first responsive HTML and CSS with media queries, flexible units, and adaptive layouts. Create designs that work across all devices from phones to large desktops.

AI Responsive GeneratorMade by AIFreeForever
Generate my responsive code free
DetailInformation
ToolAI Responsive Generator by AIFreeForever
What it can doGenerate responsive HTML and CSS, make pasted code responsive, and more
ApproachesMobile First, Desktop First, Adaptive (Specific Breakpoints)
CSS unitsrem/em, px, % and more
Breakpoints768px, 1024px, 1440px and more
PricingFree

Why Use the AI Responsive Generator?

Writing media queries for every screen size takes time. The AI Responsive Generator writes the code for you. It runs on several AI models you can switch between and compare, such as Claude Haiku 5.5, GPT-6 Luna and more.

  • AIFreeForever's AI Responsive Generator is free to use.
  • No login, no sign up for your first few messages.
  • After that, you may be asked to verify your email with a one-time code.

How to Use AI Responsive Design Generator

Follow these simple steps to use the ai responsive design generator:

  1. 1

    Describe the component or layout

    Type into AIFreeForever's chat box the part you need, such as a navbar, product grid or hero section. You can also paste your own HTML and CSS.

  2. 2

    Select responsive approach (mobile-first recommended)

    Pick Mobile First, Desktop First or Adaptive under Responsive Approach on the settings card.

  3. 3

    Choose CSS units strategy (rem, px, or fluid)

    Choose rem/em, px, % and vw/vh or Mixed under CSS Units to set how sizes scale.

  4. 4

    Generate HTML and CSS with breakpoints

    Press Generate Responsive Code to receive one HTML page with its media queries, then open the Preview.

  5. 5

    Test across different screen sizes

    Download responsive.html, open it in a browser and resize the window or use the device toolbar to check each width.

The Responsive Design Checklist, 2026 Free PDF with:
  • Common breakpoint widths
  • A CSS units guide
  • A request template for the AI Responsive Generator
  • A checklist to test a design at every screen size
Download free PDF

Mobile-First, Desktop-First and Adaptive Design Compared

AIFreeForever's AI Responsive Generator writes the media queries for whichever approach you pick on the settings card.

ApproachHow the design changesWidthsTry it
Mobile First The design starts with the phone layout from 320px wide and adds min-width media queries at 768px, 1024px and 1440px. This suits a site most visitors open on a phone. 768px1024px1440px
Desktop First The design starts with the large desktop layout and removes columns with max-width queries at 1439px, 1023px and 767px. This suits a desktop site being made to work on phones. 1439px1023px767px
Adaptive (Specific Breakpoints) The design snaps to set layouts with fixed container widths at each breakpoint, and you can name your own breakpoints. This suits a design that needs a set layout for each screen size. 768px1024px1440px

Which CSS Units to Use for Responsive Design

The CSS Units choice in AIFreeForever's Responsive Generator decides how sizes in the generated code react to the screen and to the reader's font size.

px (Fixed)

Sizes stay exact and the container gets a max-width. Pick px when a design needs precise, unchanging measurements.

Examples of Content Generated by AI Responsive Design Generator

The four examples are real pages made by AIFreeForever's AI Responsive Generator, each shown working beside its HTML and CSS. They help web designers, developers and students who want a responsive part to copy into their own site. Pressing Generate like this puts the example's description, approach and units on the settings card.

Here are some examples of what you can create with our tool:

Responsive navigation with mobile hamburger menu

A responsive navigation bar with a logo, five links and a call to action button that becomes a hamburger menu on phones, above a short page intro

Mobile First · rem/em · 124 lines
<!doctype html>
<!-- Design: Responsive top bar with hamburger nav, above a short page intro -->
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Responsive Nav and Intro</title>
<style>
/* Variables: colours and spacing scale */
:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --ink: #2f2a26;
  --muted: #6b625a;
  --accent: #7a9e7e;
  --accent-dark: #5d7f61;
  --border: #e6e0d8;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --radius: 0.5rem;
}

/* Base: reset, fluid type, focus style */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, sans-serif; line-height: 1.6; color: var(--ink); background: var(--bg); font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem); }
img, picture, svg { max-width: 100%; height: auto; display: block; }
a:focus-visible, button:focus-visible, label:focus-within { outline: 3px solid var(--accent-dark); outline-offset: 2px; }

/* Site header: bar with logo, checkbox hamburger, CTA (phone base) */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-nav { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: 0.75em var(--space-2); max-width: 75rem; margin: 0 auto; }
.logo { display: flex; align-items: center; gap: 0.5em; font-weight: 700; color: var(--ink); text-decoration: none; }
.logo svg { width: 2rem; height: 2rem; }

/* Hamburger: hidden checkbox toggles the links, keyboard reachable */
.nav-toggle-input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.nav-toggle { display: inline-flex; align-items: center; gap: 0.5em; min-height: 44px; padding: 0.5em 0.75em; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; font-size: 1rem; color: var(--ink); }
.nav-toggle svg { width: 1.25rem; height: 1.25rem; }
.nav-links { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--border); margin: 0; padding: var(--space-1) var(--space-2); list-style: none; flex-direction: column; }
.site-header { position: relative; }
.nav-toggle-input:checked ~ .nav-links { display: flex; }
.nav-links a { display: block; padding: 0.75em 0.5em; min-height: 44px; color: var(--ink); text-decoration: none; border-radius: var(--radius); }
.nav-links a:hover { background: var(--bg); }

/* CTA button: full width row on phones */
.nav-cta { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0.6em 1.2em; background: var(--accent); color: #ffffff; border-radius: var(--radius); text-decoration: none; font-weight: 600; }
.nav-cta:hover { background: var(--accent-dark); }

/* Hero intro: stacked content with placeholder image (phone base) */
.hero { max-width: 75rem; margin: 0 auto; padding: var(--space-4) var(--space-2); display: grid; gap: var(--space-3); }
.hero-text h1 { margin: 0 0 0.5em; font-size: clamp(1.6rem, 1.2rem + 2vw, 2.5rem); line-height: 1.2; }
.hero-text p { margin: 0 0 1.2em; color: var(--muted); max-width: 40rem; }
.hero-image img { width: 100%; height: 16rem; object-fit: cover; border-radius: var(--radius); }

/* Tablet from 48em (768px): links shown inline, hamburger hidden */
@media (min-width: 48em) {
  .site-nav { padding: 0.75em var(--space-3); }
  .nav-toggle { display: none; }
  .nav-links { display: flex; position: static; flex-direction: row; border: 0; padding: 0; background: transparent; gap: var(--space-1); }
  .nav-links a { padding: 0.5em 0.75em; }
  .hero { grid-template-columns: 1.1fr 1fr; align-items: center; padding: var(--space-4) var(--space-3); gap: var(--space-4); }
  .hero-image img { height: 20rem; }
}

/* Desktop from 64em (1024px): more breathing room */
@media (min-width: 64em) {
  .site-nav { padding: 0.75em var(--space-4); }
  .hero { padding: var(--space-4); }
  .hero-image img { height: 24rem; }
}

/* Large desktop from 90em (1440px): cap content width */
@media (min-width: 90em) {
  .hero-text h1 { font-size: 3rem; }
}
</style>
</head>
<body>

<header class="site-header">
  <nav class="site-nav" aria-label="Main navigation">
    <a class="logo" href="#top">
      <!-- Swap the inline SVG for a real logo file -->
      <svg viewBox="0 0 32 32" width="32" height="32" role="img" aria-label="Logo placeholder"><circle cx="16" cy="16" r="14" fill="#7a9e7e"/><rect x="10" y="10" width="12" height="12" rx="3" fill="#faf7f2"/></svg>
      <span>Placeholder Co</span>
    </a>
    <input type="checkbox" id="nav-toggle-input" class="nav-toggle-input">
    <label class="nav-toggle" for="nav-toggle-input" tabindex="0">
      <svg viewBox="0 0 24 24" width="20" height="20" aria-hidden="true"><path d="M3 6h18M3 12h18M3 18h18" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>
      Menu
    </label>
    <ul class="nav-links">
      <li><a href="#">Home</a></li>
      <li><a href="#">About</a></li>
      <li><a href="#">Services</a></li>
      <li><a href="#">Blog</a></li>
      <li><a href="#">Contact</a></li>
    </ul>
    <a class="nav-cta" href="#">Get Started</a>
  </nav>
</header>

<main id="top">
  <section class="hero">
    <div class="hero-text">
      <h1>A short page intro goes here</h1>
      <p>Replace this with one or two sentences that explain what the page offers and why a visitor should keep reading.</p>
      <a class="nav-cta" href="#">Learn More</a>
    </div>
    <div class="hero-image">
      <!-- Swap the data URI for a real image file; keep srcset and sizes -->
      <img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 600'%3E%3Crect width='800' height='600' fill='%23d8e4d9'/%3E%3C/svg%3E"
           srcset="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 300'%3E%3Crect width='400' height='300' fill='%23d8e4d9'/%3E%3C/svg%3E 400w,
                  data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 600'%3E%3Crect width='800' height='600' fill='%23d8e4d9'/%3E%3C/svg%3E 800w"
           sizes="(min-width: 48em) 40rem, 100vw"
           width="800" height="600" alt="Placeholder hero image">
    </div>
  </section>
</main>

</body>
</html>

Card grid that adjusts from 1 to 4 columns

A product card grid that shows four columns on large desktops, three on desktops, two on tablets and one on phones, each card with a picture, name, price and button

Desktop First · Mixed · 137 lines
<!doctype html>
<!-- Product card grid: 4 / 3 / 2 / 1 columns, desktop-first -->
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Product Grid</title>
<style>
/* Variables: soft colours and spacing scale (rem units) */
:root {
  --bg: #faf7f2;
  --card-bg: #ffffff;
  --ink: #33302b;
  --muted: #6f6a61;
  --accent: #7a9e7e;
  --accent-dark: #5d7f61;
  --radius: 0.75rem;
  --space: 1.5rem;
}

/* Base: border-box, reset margins, fluid media */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.6; }
img, picture, svg { max-width: 100%; height: auto; display: block; }

/* Visible focus for keyboard users */
a:focus-visible, button:focus-visible, label:focus-visible {
  outline: 3px solid var(--accent-dark);
  outline-offset: 2px;
}

/* Site header and nav: flex row, stacks under 767px */
.site-header { background: var(--card-bg); border-bottom: 1px solid #e8e2d8; }
.site-nav { display: flex; align-items: center; justify-content: space-between; gap: var(--space); max-width: 75rem; margin: 0 auto; padding: 1rem var(--space); }
.site-nav a { color: var(--ink); text-decoration: none; padding: 0.75rem 0; }
.site-nav a:hover { color: var(--accent-dark); }

/* Hero: clamp() heading scales with viewport width */
.hero { max-width: 75rem; margin: 0 auto; padding: clamp(2rem, 5vw, 4rem) var(--space); text-align: center; }
.hero h1 { font-size: clamp(1.75rem, 4vw, 3rem); margin: 0 0 0.5rem; }
.hero p { color: var(--muted); margin: 0; }

/* Product grid: base is 4 columns for large desktops (fr units + rem gap) */
.products { max-width: 75rem; margin: 0 auto; padding: 0 var(--space) var(--space); }
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space);
}

/* Product card: flex column so button sits at the bottom */
.product-card {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid #e8e2d8;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}
.product-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.product-card h2 { font-size: 1.125rem; margin: 1rem 1rem 0.25rem; }
.product-card .price { color: var(--accent-dark); font-weight: 700; margin: 0 1rem 1rem; }
.product-card .buy { margin: auto 1rem 1rem; padding: 0.75rem 1rem; min-height: 44px; border: none; border-radius: var(--radius); background: var(--accent); color: #fff; font-size: 1rem; cursor: pointer; }
.product-card .buy:hover { background: var(--accent-dark); }

/* Under 1440px (90em): 3 columns on smaller desktops */
@media (max-width: 89.99em) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Under 1024px (64em): 2 columns on tablets */
@media (max-width: 63.99em) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Under 768px (48em): 1 column on phones, nav stacks vertically */
@media (max-width: 47.99em) {
  .product-grid { grid-template-columns: 1fr; }
  .site-nav { flex-direction: column; align-items: flex-start; }
}
</style>
</head>
<body>

<header class="site-header">
  <nav class="site-nav" aria-label="Main">
    <a href="#">Shop Name</a>
    <a href="#">Products</a>
    <a href="#">About</a>
    <a href="#">Contact</a>
  </nav>
</header>

<main>
  <section class="hero">
    <h1>Our Products</h1>
    <p>Short placeholder line describing the collection goes here.</p>
  </section>

  <section class="products" aria-label="Product list">
    <!-- Grid: 4 columns large desktop, 3 desktop, 2 tablet, 1 phone -->
    <div class="product-grid">
      <!-- Card 1: swap the data URI for a real image file -->
      <article class="product-card">
        <img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='300'%3E%3Crect width='400' height='300' fill='%23dce8dc'/%3E%3C/svg%3E" alt="Placeholder product photo" width="400" height="300">
        <h2>Product One</h2>
        <p class="price">$19.00</p>
        <button class="buy" type="button">Add to cart</button>
      </article>
      <!-- Card 2 -->
      <article class="product-card">
        <img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='300'%3E%3Crect width='400' height='300' fill='%23e8e0d2'/%3E%3C/svg%3E" alt="Placeholder product photo" width="400" height="300">
        <h2>Product Two</h2>
        <p class="price">$29.00</p>
        <button class="buy" type="button">Add to cart</button>
      </article>
      <!-- Card 3 -->
      <article class="product-card">
        <img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='300'%3E%3Crect width='400' height='300' fill='%23d8dce8'/%3E%3C/svg%3E" alt="Placeholder product photo" width="400" height="300">
        <h2>Product Three</h2>
        <p class="price">$39.00</p>
        <button class="buy" type="button">Add to cart</button>
      </article>
      <!-- Card 4 -->
      <article class="product-card">
        <img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='300'%3E%3Crect width='400' height='300' fill='%23eadce4'/%3E%3C/svg%3E" alt="Placeholder product photo" width="400" height="300">
        <h2>Product Four</h2>
        <p class="price">$49.00</p>
        <button class="buy" type="button">Add to cart</button>
      </article>
    </div>
  </section>
</main>

</body>
</html>

Hero section with responsive background images

A full-height hero section with a responsive background picture, a headline, a short line of text and two buttons

Mobile First · % and vw/vh · 147 lines
<!doctype html>
<!-- Design: Full-height hero with fluid type and responsive placeholder image -->
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Full-Height Hero</title>
<style>
/* Variables: colours and spacing scale */
:root {
  --ink: #2d2a26;
  --paper: #faf7f2;
  --accent: #7a9e7e;
  --accent-dark: #5d7f61;
  --soft: #e9e2d8;
  --space: clamp(1rem, 3vw, 2.5rem);
  --radius: 12px;
}

/* Base: reset, fluid type, media rules */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, sans-serif; color: var(--ink); background: var(--paper); line-height: 1.6; }
img, picture, svg { max-width: 100%; height: auto; display: block; }
a:focus-visible, button:focus-visible, label:focus-visible { outline: 3px solid var(--accent-dark); outline-offset: 2px; }

/* Site header: simple flex bar with checkbox menu */
.site-header { background: var(--paper); padding: 0.75rem var(--space); }
.site-nav { display: flex; align-items: center; justify-content: space-between; }
.site-logo { font-weight: 700; font-size: 1.125rem; text-decoration: none; color: var(--ink); }
.nav-toggle-input { position: absolute; opacity: 0; }
.nav-toggle-label { display: block; width: 44px; height: 44px; line-height: 44px; text-align: center; font-size: 1.5rem; cursor: pointer; border-radius: var(--radius); }
.nav-links { display: none; list-style: none; margin: 0; padding: 0; }
.nav-links a { display: block; min-height: 44px; line-height: 44px; padding: 0 0.75rem; text-decoration: none; color: var(--ink); }
.nav-toggle-input:checked ~ .nav-links { display: block; }

/* Hero: full-height section, fluid headline, stacked buttons on phone */
.hero { position: relative; min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; text-align: center; padding: var(--space); overflow: hidden; }
.hero-picture, .hero-picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-content { position: relative; max-width: 60ch; background: rgba(250, 247, 242, 0.85); padding: clamp(1.5rem, 4vw, 3rem); border-radius: var(--radius); }
.hero-title { font-size: clamp(1.75rem, 6vw, 3.5rem); margin: 0 0 0.5em; line-height: 1.15; }
.hero-text { font-size: clamp(1rem, 2.5vw, 1.25rem); margin: 0 0 1.5em; }
.hero-actions { display: flex; flex-direction: column; gap: 0.75rem; }
.btn { display: block; min-height: 48px; padding: 0.75rem 1.5rem; border-radius: var(--radius); text-decoration: none; font-weight: 600; font-size: 1rem; line-height: 1.75; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { background: transparent; color: var(--ink); border: 2px solid var(--ink); }

/* Main content: intro section under the hero */
.intro { padding: calc(var(--space) * 2) var(--space); max-width: 60rem; margin: 0 auto; }
.intro-title { font-size: clamp(1.5rem, 4vw, 2.25rem); margin: 0 0 0.5em; }

/* Feature grid: 1 column on phone, auto-fitting cards */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr)); gap: var(--space); margin-top: var(--space); }
.feature-card { background: var(--soft); border-radius: var(--radius); padding: 1rem; }
.feature-card h3 { margin: 0.75rem 0 0.25rem; }

/* Site footer: centred small print */
.site-footer { text-align: center; padding: var(--space); color: #6b655c; font-size: 0.9rem; }

/* Tablet 768px: nav links inline, buttons side by side */
@media (min-width: 768px) {
  .nav-toggle-label { display: none; }
  .nav-links { display: flex; gap: 0.5rem; }
  .hero-content { background: rgba(250, 247, 242, 0.75); }
  .hero-actions { flex-direction: row; justify-content: center; }
  .btn { display: inline-block; }
}

/* Desktop 1024px: wider hero text and larger spacing */
@media (min-width: 1024px) {
  :root { --space: clamp(2rem, 4vw, 4rem); }
  .hero-content { max-width: 70ch; }
}

/* Large desktop 1440px: cap content width */
@media (min-width: 1440px) {
  .intro { max-width: 70rem; }
}
</style>
</head>
<body>

<header class="site-header">
  <nav class="site-nav" aria-label="Main navigation">
    <a class="site-logo" href="#top">Placeholder Co</a>
    <input class="nav-toggle-input" type="checkbox" id="nav-toggle">
    <label class="nav-toggle-label" for="nav-toggle" aria-label="Toggle menu">&#9776;</label>
    <ul class="nav-links">
      <li><a href="#top">Home</a></li>
      <li><a href="#features">Features</a></li>
      <li><a href="#contact">Contact</a></li>
    </ul>
  </nav>
</header>

<!-- Hero: full-height with responsive picture; swap the data URIs for real files -->
<section class="hero" id="top">
  <picture class="hero-picture">
    <!-- Small screens: narrow crop -->
    <source media="(max-width: 767px)"
      srcset="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='640' height='960'%3E%3Crect width='640' height='960' fill='%23cfe3d0'/%3E%3C/svg%3E">
    <!-- Larger screens: wide crop -->
    <source media="(min-width: 768px)"
      srcset="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1600' height='900'%3E%3Crect width='1600' height='900' fill='%23dfe8d2'/%3E%3C/svg%3E">
    <img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1600' height='900'%3E%3Crect width='1600' height='900' fill='%23dfe8d2'/%3E%3C/svg%3E"
      alt="Soft green placeholder scenery" width="1600" height="900">
  </picture>
  <div class="hero-content">
    <h1 class="hero-title">A Calm, Full-Height Welcome</h1>
    <p class="hero-text">Replace this short line with your own message. It stays readable at every width.</p>
    <div class="hero-actions">
      <a class="btn btn-primary" href="#features">Get Started</a>
      <a class="btn btn-secondary" href="#contact">Learn More</a>
    </div>
  </div>
</section>

<main>
  <section class="intro" id="features">
    <h2 class="intro-title">Why Choose Us</h2>
    <p>Short placeholder text describing your three main features. Swap each card for real content.</p>
    <div class="feature-grid">
      <article class="feature-card">
        <img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='260'%3E%3Crect width='400' height='260' fill='%23e3d9c8'/%3E%3C/svg%3E" alt="Placeholder image one" width="400" height="260">
        <h3>Feature One</h3>
        <p>One sentence about this feature.</p>
      </article>
      <article class="feature-card">
        <img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='260'%3E%3Crect width='400' height='260' fill='%23d8e0e8'/%3E%3C/svg%3E" alt="Placeholder image two" width="400" height="260">
        <h3>Feature Two</h3>
        <p>One sentence about this feature.</p>
      </article>
      <article class="feature-card">
        <img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='260'%3E%3Crect width='400' height='260' fill='%23e8d8dd'/%3E%3C/svg%3E" alt="Placeholder image three" width="400" height="260">
        <h3>Feature Three</h3>
        <p>One sentence about this feature.</p>
      </article>
    </div>
  </section>
</main>

<footer class="site-footer" id="contact">
  <p>Placeholder footer text. Add your contact details here.</p>
</footer>

</body>
</html>

Responsive typography with fluid scaling

An article page with responsive typography: a title, a subtitle, body paragraphs, a pull quote and a list, with fluid text sizes that grow from phone to desktop

Adaptive · rem/em · 146 lines
<!doctype html>
<!-- Article page: fluid typography with adaptive breakpoints -->
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Responsive Article Page</title>
<style>
/* Breakpoints: base is phone; 48em (768px) tablet; 64em (1024px) desktop; 90em (1440px) wide */

/* Custom properties: colours and spacing */
:root {
  --paper: #fbf9f6;
  --ink: #2e2a26;
  --muted: #6b625a;
  --accent: #4a7c6f;
  --accent-soft: #e4efeb;
  --line: #ded7cf;
  --gap: 1.25rem;
  --max: 44rem;
}

/* Base resets and image safety */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: Georgia, "Times New Roman", serif; background: var(--paper); color: var(--ink); line-height: 1.6; font-size: 1rem; }
img, picture, svg { max-width: 100%; height: auto; display: block; }

/* Visible focus for keyboard users */
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 0.1875em solid var(--accent);
  outline-offset: 0.125em;
}

/* Header and nav: simple flex row, stacks on phone */
.site-header { border-bottom: 1px solid var(--line); background: #fff; }
.site-header .inner { max-width: var(--max); margin: 0 auto; padding: 1em var(--gap); display: flex; flex-wrap: wrap; align-items: center; gap: 0.5em 1.5em; }
.site-title { font-size: 1.25rem; margin: 0; }
.site-nav { display: flex; flex-wrap: wrap; gap: 0.25em 1em; }
.site-nav a { color: var(--accent); text-decoration: none; padding: 0.75em 0.5em; min-height: 44px; display: inline-flex; align-items: center; }
.site-nav a:hover { text-decoration: underline; }

/* Article container */
.article { max-width: var(--max); margin: 0 auto; padding: clamp(1.5rem, 5vw, 3rem) var(--gap); }

/* Fluid typography: headline scales with clamp() */
.article h1 { font-size: clamp(1.75rem, 5vw, 3rem); line-height: 1.15; margin: 0 0 0.4em; }
.article .subtitle { font-size: clamp(1.0625rem, 2.5vw, 1.375rem); color: var(--muted); font-style: italic; margin: 0 0 2em; }
.article h2 { font-size: clamp(1.25rem, 3vw, 1.75rem); margin: 1.8em 0 0.5em; }
.article p { font-size: clamp(1rem, 1.5vw, 1.125rem); margin: 0 0 1.2em; }

/* Lead image, alt text and srcset to swap for real files */
.article-figure { margin: 0 0 2em; }
.article-figure img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 0.5rem; background: var(--accent-soft); }
.article-figure figcaption { font-size: 0.875rem; color: var(--muted); padding-top: 0.5em; }

/* Pull quote: accent bar, grows on wide screens */
.pull-quote { border-left: 0.25em solid var(--accent); background: var(--accent-soft); padding: 1em 1.25em; margin: 2em 0; font-size: clamp(1.25rem, 3vw, 1.75rem); font-style: italic; line-height: 1.35; }
.pull-quote p { margin: 0; font-size: inherit; }
.pull-quote cite { display: block; font-size: 0.875rem; font-style: normal; color: var(--muted); margin-top: 0.75em; }

/* Styled list inside the article */
.article-list { padding-left: 1.25em; margin: 0 0 1.5em; font-size: clamp(1rem, 1.5vw, 1.125rem); }
.article-list li { margin-bottom: 0.5em; }
.article-list li::marker { color: var(--accent); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); text-align: center; padding: 1.5em var(--gap); font-size: 0.875rem; color: var(--muted); }

/* 48em / 768px: fixed 720px article width, roomier spacing */
@media (min-width: 48em) {
  :root { --max: 45rem; }
  .article { padding-top: 3rem; padding-bottom: 3rem; }
}

/* 64em / 1024px: fixed 960px container, wider measure for text */
@media (min-width: 64em) {
  :root { --max: 60rem; }
  .article p, .article-list { font-size: 1.125rem; }
}

/* 90em / 1440px: fixed 1320px shell, larger reading size */
@media (min-width: 90em) {
  :root { --max: 82.5rem; }
  .article-inner { max-width: 45rem; margin: 0 auto; }
  .article p, .article-list { font-size: 1.1875rem; }
}
</style>
</head>
<body>

<header class="site-header">
  <div class="inner">
    <p class="site-title">Sample Journal</p>
    <nav class="site-nav" aria-label="Site">
      <a href="#">Home</a>
      <a href="#">Articles</a>
      <a href="#">About</a>
    </nav>
  </div>
</header>

<main class="article">
  <div class="article-inner">
    <h1>A Short Title About Responsive Typography</h1>
    <p class="subtitle">A subtitle that explains what this article is about in one calm sentence.</p>

    <figure class="article-figure">
      <!-- Replace the data URI with a real image file, keep srcset and sizes -->
      <img
        src="data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='675'%3E%3Crect width='1200' height='675' fill='%23e4efeb'/%3E%3C/svg%3E"
        srcset="data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='338'%3E%3Crect width='600' height='338' fill='%23e4efeb'/%3E%3C/svg%3E 600w,
                data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='675'%3E%3Crect width='1200' height='675' fill='%23e4efeb'/%3E%3C/svg%3E 1200w"
        sizes="(min-width: 48em) 720px, 100vw"
        width="1200" height="675"
        alt="Soft green placeholder image for the article">
      <figcaption>Placeholder caption describing the lead image.</figcaption>
    </figure>

    <p>This opening paragraph introduces the topic. Everything on this page uses rem and em units, so text sizes stay comfortable even when a visitor changes their browser font size. Fluid sizes use clamp() and grow smoothly between the breakpoints.</p>

    <blockquote class="pull-quote">
      <p>Text that people should remember goes here, standing out from the body copy.</p>
      <cite>Placeholder attribution</cite>
    </blockquote>

    <p>After the pull quote, the article continues with supporting paragraphs. Replace each paragraph with your own words. Spacing is set in em inside components, so it scales with the surrounding text rather than staying fixed.</p>

    <h2>A Short Section Heading</h2>

    <p>Here a list breaks up the prose and keeps the page easy to scan on small screens:</p>
    <ul class="article-list">
      <li>First point of the list goes here.</li>
      <li>Second point with a little more detail.</li>
      <li>Third point to close the list.</li>
    </ul>

    <p>A closing paragraph wraps up the article. The layout is adaptive: it snaps to set container widths at 48em, 64em and 90em, and never overflows at 320px wide.</p>
  </div>
</main>

<footer class="site-footer">
  <p>Placeholder footer text for your site.</p>
</footer>

</body>
</html>

Features of Our AI Responsive Generator

AIFreeForever's AI Responsive Generator writes media queries for your chosen approach, flexible CSS units you pick, and a live preview of every page.

01

Media Queries

Mobile First adds min-width queries at 768px, 1024px and 1440px, and you can name your own breakpoints.

02

CSS Units

Choose rem/em, px, fluid % and vw/vh with clamp(). You can also pick Mixed, and the code follows your choice.

03

Live Preview

Every page has a Preview button that draws the design in a safe frame before you copy it.

04

Responsive Pictures

Images use srcset, sizes, the picture element and object-fit, with placeholders to swap for real files.

05

Flexbox and Grid

Layouts use Flexbox and CSS Grid with gap, plus clamp() or calc() where a size should scale.

06

CSS-Only Menu

A hamburger menu opens with CSS only, and tap targets stay at least 44px tall on phones.

Frequently Asked Questions

Why Choose AIFreeForever's AI Responsive Generator?

Every developer wants a site that reads well on a phone and a desktop, and AIFreeForever's AI Responsive Generator builds that code for you.

Free to Use

Generate responsive HTML and CSS for free on AIFreeForever.

Paste Your Code

Make your own HTML and CSS responsive by pasting it into the chat box.

Three Approaches

Pick the responsive strategy that suits your project, from mobile first to adaptive layouts.

Four Unit Choices

Choose the CSS units you want, from flexible text sizing to fluid scaling.

One File Download

Download your whole page as responsive.html, with the viewport meta tag included.

Ask for Changes

Request a dark mode, an extra breakpoint or a hamburger menu in the chat box.
Generate responsive code for free from the free AI Responsive Generator: a developer's desk with a laptop, tablet and phone showing the same layout at different sizes

Generate Responsive Code for Free

Pick your approach and CSS units, describe your design or paste your code, and get responsive HTML and CSS from AIFreeForever's AI Responsive Generator.

Related Developer Tools

By the AIFreeForever Research Team Last updated