首屏是页面的第一屏,说明这是什么、为什么值得关注,并给出一个可采取的行动。文案由一个采用展示字号的标题和下方的导语组成。标题字号随区块宽度调整,其余内容均可选。
首屏
<section class="container-inline px-lg py-4xl" aria-labelledby="hero-title"> <div class="flex flex-col items-center gap-lg max-w(760) mx-auto text-center"> <a class="badge badge-raised badge-pill" href="#"> New: preview comments<svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> <path d="M13.6362 7.5189A0.4947 0.4947 0 0 0 13.5 7.5L2.4755 7.5006A0.5 0.5 0 0 0 2.4266 8.4946L2.5 8.5H13.5A0.4947 0.4947 0 0 0 13.6362 8.4811A0.7009 0.7009 0 0 0 13.6362 7.5189Z" fill="currentColor" stroke="none" fill-rule="evenodd" /><path d="M8 4.5L13.2348 7.8313A0.2 0.2 0 0 1 13.2348 8.1687L8 11.5" /> </svg> </a> <h1 class="heading heading-display" id="hero-title">Ship the web, quietly.</h1> <p class="lead lead-lg max-w(560)"> Atlas turns every push into a deployment with its own address, in fourteen regions, in under a minute. </p> <div class="flex flex-wrap justify-center gap-sm"> <a class="btn btn-brand btn-lg" href="#">Start deploying</a> <a class="btn btn-lg" href="#">Read the docs</a> </div> <p class="m(0) text-xs fg-text-muted">Free for personal projects. No card needed.</p> </div></section>import ArrowRightIcon from '@master/icons-react/native/16/soft/arrow-right'<section className="container-inline px-lg py-4xl" aria-labelledby="hero-title"> <div className="flex flex-col items-center gap-lg max-w(760) mx-auto text-center"> <a className="badge badge-raised badge-pill" href="#"> New: preview comments<ArrowRightIcon className="icon" /> </a> <h1 className="heading heading-display" id="hero-title">Ship the web, quietly.</h1> <p className="lead lead-lg max-w(560)"> Atlas turns every push into a deployment with its own address, in fourteen regions, in under a minute. </p> <div className="flex flex-wrap justify-center gap-sm"> <a className="btn btn-brand btn-lg" href="#">Start deploying</a> <a className="btn btn-lg" href="#">Read the docs</a> </div> <p className="m(0) text-xs fg-text-muted">Free for personal projects. No card needed.</p> </div></section><script> import ArrowRightIcon from '@master/icons-svelte/native/16/soft/arrow-right'</script><section class="container-inline px-lg py-4xl" aria-labelledby="hero-title"> <div class="flex flex-col items-center gap-lg max-w(760) mx-auto text-center"> <a class="badge badge-raised badge-pill" href="#"> New: preview comments<ArrowRightIcon class="icon" /> </a> <h1 class="heading heading-display" id="hero-title">Ship the web, quietly.</h1> <p class="lead lead-lg max-w(560)"> Atlas turns every push into a deployment with its own address, in fourteen regions, in under a minute. </p> <div class="flex flex-wrap justify-center gap-sm"> <a class="btn btn-brand btn-lg" href="#">Start deploying</a> <a class="btn btn-lg" href="#">Read the docs</a> </div> <p class="m(0) text-xs fg-text-muted">Free for personal projects. No card needed.</p> </div></section><script setup>import ArrowRightIcon from '@master/icons-vue/native/16/soft/arrow-right'</script><template> <section class="container-inline px-lg py-4xl" aria-labelledby="hero-title"> <div class="flex flex-col items-center gap-lg max-w(760) mx-auto text-center"> <a class="badge badge-raised badge-pill" href="#"> New: preview comments<ArrowRightIcon class="icon" /> </a> <h1 class="heading heading-display" id="hero-title">Ship the web, quietly.</h1> <p class="lead lead-lg max-w(560)"> Atlas turns every push into a deployment with its own address, in fourteen regions, in under a minute. </p> <div class="flex flex-wrap justify-center gap-sm"> <a class="btn btn-brand btn-lg" href="#">Start deploying</a> <a class="btn btn-lg" href="#">Read the docs</a> </div> <p class="m(0) text-xs fg-text-muted">Free for personal projects. No card needed.</p> </div> </section></template>区块提供可直接复制的标记,沿用页面自身的文字颜色和字号。预览在 body 上设置 fg-text-body text-sm。每个区块都是尺寸容器,会按自身宽度重排。
#组成
- 限制内容列的最大宽度,并将其居中。 在带有
gap-lg的列上设置max-w(760) mx-auto text-center。导语单独采用更窄的宽度,即使标题很宽,下方的导语也能保持较短的行长。 - 展示标题。
heading heading-display使用容器单位设置字号,在手机的窄列中为 2.5rem,在宽列中为 4.25rem,各种字号下的行长都保持均衡。section 是容器。 - 最多两个操作。 主操作使用
btn-brand或btn-primary,另一个操作使用默认按钮或低调按钮。flex flex-wrap justify-center让按钮在空间不足时自动换行,无需借助查询切换布局。 - 一行简短说明,打消顾虑。 用
text-xs fg-text-muted写明试用成本。
品牌按钮是系统中唯一带色相的控件。首屏使用品牌按钮时,其余元素应保持中性色。
#带图片
在文案下方放一个图文块,用托盘为图片留出一圈衬边。用 --figure-ratio 设置图片的宽高比,避免图片加载时页面跳动。
带图片
<section class="container-inline px-lg py-4xl" aria-labelledby="hero-media-title"> <div class="flex flex-col items-center gap-lg max-w(760) mx-auto text-center"> <p class="eyebrow">Deployments</p> <h1 class="heading heading-display" id="hero-media-title">Every push gets an address.</h1> <p class="lead max-w(520)"> Open a pull request and share the link. What you review is what ships. </p> <div class="flex flex-wrap justify-center gap-sm"> <a class="btn btn-primary btn-lg" href="#">Start deploying</a> <a class="btn btn-quiet btn-lg" href="#"> See how it works<svg class="icon" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> <path d="M17.2077 9.4105A0.6234 0.6234 0 0 0 17 9.375L2.9693 9.3758A0.625 0.625 0 0 0 2.9083 10.6182L3 10.625H17A0.6234 0.6234 0 0 0 17.2077 10.5895A0.8258 0.8258 0 0 0 17.2077 9.4105Z" fill="currentColor" stroke="none" fill-rule="evenodd" /><path d="M10 5.5L16.7383 9.8318A0.2 0.2 0 0 1 16.7383 10.1682L10 14.5" /> </svg> </a> </div> </div> <figure class="figure figure-framed max-w(1040) mx-auto mt-3xl"> <img class="figure-media" src="/demo/scenes/wallpaper-dawn-silk-16x9.webp" alt width="2000" height="1125" style="--figure-ratio: 16 / 9"> </figure></section>import ArrowRightIcon from '@master/icons-react/native/20/soft/arrow-right'<section className="container-inline px-lg py-4xl" aria-labelledby="hero-media-title"> <div className="flex flex-col items-center gap-lg max-w(760) mx-auto text-center"> <p className="eyebrow">Deployments</p> <h1 className="heading heading-display" id="hero-media-title">Every push gets an address.</h1> <p className="lead max-w(520)"> Open a pull request and share the link. What you review is what ships. </p> <div className="flex flex-wrap justify-center gap-sm"> <a className="btn btn-primary btn-lg" href="#">Start deploying</a> <a className="btn btn-quiet btn-lg" href="#"> See how it works<ArrowRightIcon className="icon" /> </a> </div> </div> <figure className="figure figure-framed max-w(1040) mx-auto mt-3xl"> <img className="figure-media" src="/demo/scenes/wallpaper-dawn-silk-16x9.webp" alt="" width="2000" height="1125" style={{ '--figure-ratio': '16 / 9' } as React.CSSProperties} /> </figure></section><script> import ArrowRightIcon from '@master/icons-svelte/native/20/soft/arrow-right'</script><section class="container-inline px-lg py-4xl" aria-labelledby="hero-media-title"> <div class="flex flex-col items-center gap-lg max-w(760) mx-auto text-center"> <p class="eyebrow">Deployments</p> <h1 class="heading heading-display" id="hero-media-title">Every push gets an address.</h1> <p class="lead max-w(520)"> Open a pull request and share the link. What you review is what ships. </p> <div class="flex flex-wrap justify-center gap-sm"> <a class="btn btn-primary btn-lg" href="#">Start deploying</a> <a class="btn btn-quiet btn-lg" href="#">See how it works<ArrowRightIcon class="icon" /></a> </div> </div> <figure class="figure figure-framed max-w(1040) mx-auto mt-3xl"> <img class="figure-media" src="/demo/scenes/wallpaper-dawn-silk-16x9.webp" alt width="2000" height="1125" style="--figure-ratio: 16 / 9"> </figure></section><script setup>import ArrowRightIcon from '@master/icons-vue/native/20/soft/arrow-right'</script><template> <section class="container-inline px-lg py-4xl" aria-labelledby="hero-media-title"> <div class="flex flex-col items-center gap-lg max-w(760) mx-auto text-center"> <p class="eyebrow">Deployments</p> <h1 class="heading heading-display" id="hero-media-title">Every push gets an address.</h1> <p class="lead max-w(520)"> Open a pull request and share the link. What you review is what ships. </p> <div class="flex flex-wrap justify-center gap-sm"> <a class="btn btn-primary btn-lg" href="#">Start deploying</a> <a class="btn btn-quiet btn-lg" href="#">See how it works<ArrowRightIcon class="icon" /></a> </div> </div> <figure class="figure figure-framed max-w(1040) mx-auto mt-3xl"> <img class="figure-media" src="/demo/scenes/wallpaper-dawn-silk-16x9.webp" alt width="2000" height="1125" style="--figure-ratio: 16 / 9"> </figure> </section></template>#双栏
区块宽度达到 64rem 时,文案与图片并排显示,采用 grid-cols(2)@container(--5xl)。宽度低于 64rem 时,两者上下排列,文案在前。第一列中的内容沿起始边对齐,适合放置表单。此处的操作由电子邮件输入框及其按钮组成,下方三条用于打消顾虑的简短说明以项目符号列表呈现,横向排列并可换行。
双栏
<section class="container-inline px-lg py-4xl" aria-labelledby="hero-split-title"> <div class="grid gap-2xl items-center max-w(1120) mx-auto grid-cols(2)@container(--5xl)"> <div class="flex flex-col items-start gap-lg"> <p class="eyebrow">Analytics</p> <h1 class="heading heading-display" id="hero-split-title"> Know what is slow before your visitors do. </h1> <p class="lead max-w(480)"> Real traffic and real speed, measured at the edge. No cookies and no banner to dismiss. </p> <form class="flex flex-wrap gap-xs w-full max-w(420)"> <input class="input grow(1) basis(200)" type="email" name="email" placeholder="you@example.com" aria-label="Email" autocomplete="email" required> <button class="btn btn-primary">Get early access</button> </form> <ul class="bullets bullets-check flex flex-wrap col-gap-md row-gap-2xs text-xs fg-text-muted"> <li class="bullets-item">No card needed</li> <li class="bullets-item">14 regions</li> <li class="bullets-item">Cancel any time</li> </ul> </div> <figure class="figure figure-framed"> <img class="figure-media" src="/demo/scenes/wallpaper-stone-mist-3x2.webp" alt width="2000" height="1333" style="--figure-ratio: 3 / 2"> </figure> </div></section><section className="container-inline px-lg py-4xl" aria-labelledby="hero-split-title"> <div className="grid gap-2xl items-center max-w(1120) mx-auto grid-cols(2)@container(--5xl)"> <div className="flex flex-col items-start gap-lg"> <p className="eyebrow">Analytics</p> <h1 className="heading heading-display" id="hero-split-title"> Know what is slow before your visitors do. </h1> <p className="lead max-w(480)"> Real traffic and real speed, measured at the edge. No cookies and no banner to dismiss. </p> <form className="flex flex-wrap gap-xs w-full max-w(420)"> <input className="input grow(1) basis(200)" type="email" name="email" placeholder="you@example.com" aria-label="Email" autoComplete="email" required /> <button className="btn btn-primary">Get early access</button> </form> <ul className="bullets bullets-check flex flex-wrap col-gap-md row-gap-2xs text-xs fg-text-muted"> <li className="bullets-item">No card needed</li> <li className="bullets-item">14 regions</li> <li className="bullets-item">Cancel any time</li> </ul> </div> <figure className="figure figure-framed"> <img className="figure-media" src="/demo/scenes/wallpaper-stone-mist-3x2.webp" alt="" width="2000" height="1333" style={{ '--figure-ratio': '3 / 2' } as React.CSSProperties} /> </figure> </div></section><section class="container-inline px-lg py-4xl" aria-labelledby="hero-split-title"> <div class="grid gap-2xl items-center max-w(1120) mx-auto grid-cols(2)@container(--5xl)"> <div class="flex flex-col items-start gap-lg"> <p class="eyebrow">Analytics</p> <h1 class="heading heading-display" id="hero-split-title"> Know what is slow before your visitors do. </h1> <p class="lead max-w(480)"> Real traffic and real speed, measured at the edge. No cookies and no banner to dismiss. </p> <form class="flex flex-wrap gap-xs w-full max-w(420)"> <input class="input grow(1) basis(200)" type="email" name="email" placeholder="you@example.com" aria-label="Email" autocomplete="email" required> <button class="btn btn-primary">Get early access</button> </form> <ul class="bullets bullets-check flex flex-wrap col-gap-md row-gap-2xs text-xs fg-text-muted"> <li class="bullets-item">No card needed</li> <li class="bullets-item">14 regions</li> <li class="bullets-item">Cancel any time</li> </ul> </div> <figure class="figure figure-framed"> <img class="figure-media" src="/demo/scenes/wallpaper-stone-mist-3x2.webp" alt width="2000" height="1333" style="--figure-ratio: 3 / 2"> </figure> </div></section><template> <section class="container-inline px-lg py-4xl" aria-labelledby="hero-split-title"> <div class="grid gap-2xl items-center max-w(1120) mx-auto grid-cols(2)@container(--5xl)"> <div class="flex flex-col items-start gap-lg"> <p class="eyebrow">Analytics</p> <h1 class="heading heading-display" id="hero-split-title"> Know what is slow before your visitors do. </h1> <p class="lead max-w(480)"> Real traffic and real speed, measured at the edge. No cookies and no banner to dismiss. </p> <form class="flex flex-wrap gap-xs w-full max-w(420)"> <input class="input grow(1) basis(200)" type="email" name="email" placeholder="you@example.com" aria-label="Email" autocomplete="email" required> <button class="btn btn-primary">Get early access</button> </form> <ul class="bullets bullets-check flex flex-wrap col-gap-md row-gap-2xs text-xs fg-text-muted"> <li class="bullets-item">No card needed</li> <li class="bullets-item">14 regions</li> <li class="bullets-item">Cancel any time</li> </ul> </div> <figure class="figure figure-framed"> <img class="figure-media" src="/demo/scenes/wallpaper-stone-mist-3x2.webp" alt width="2000" height="1333" style="--figure-ratio: 3 / 2"> </figure> </div> </section></template>#无障碍
- 首屏标题是页面的
<h1>。每个页面只设一个。 - 标题上方的小字用
<p>标记,说明接下来是什么类型的内容,无需使用标题元素。屏幕阅读器的标题列表应从正式标题开始。 - 用于跳转的按钮使用链接
<a class="btn">。用于提交的按钮使用<button>。 - 每个区段都通过
aria-labelledby用自身的标题命名。 - 图片展示产品时,在
alt中描述图片。图片仅用于烘托氛围时,将该属性留空。这些示例中的图片用于烘托氛围,因此alt为空。 - 单独使用的输入框带有
aria-label,并通过required让浏览器在发送任何内容之前提示还需填写什么。