Voltar à lição

Arquivo funcional original

reference/public/blog/smaller-images.html

O código e as páginas funcionais de exemplo mantêm seus identificadores e textos originais. A lição e as orientações dos arquivos explicam esses elementos no seu idioma.

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1" />
    <title>Send a smaller image to a smaller screen</title>
    <link rel="stylesheet" href="../style.css" />
  </head>
  <body>
    <main>
      <h1>Send a smaller image to a smaller screen</h1>
      <nav><a href="../index.html">All notes</a></nav>
      <article>
        <p>Practice Author · <time datetime="2026-11-15">15 November 2026</time></p>
        <p>Download size and display size are different.</p>
        <p>
          A photograph displayed at 400 pixels wide may still download as a 4000-pixel
          original. CSS width alone does not reduce that transfer.
        </p>
        <p>
          Export smaller sources and let the browser choose with srcset and sizes. Keep
          width and height attributes so space is reserved before download.
        </p>
        <p>
          Inspect the actual selected resource in developer tools at a fixed viewport and
          device pixel ratio. Compare bytes and appearance together.
        </p>
      </article>
    </main>
  </body>
</html>