主視覺是頁面的首屏,說明這是什麼、為什麼值得關注,並引導訪客採取一項行動。文字由展示尺寸的標題和下方的導言組成,標題大小會隨區塊寬度調整。其餘內容都可依需要加入。
主視覺
<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,各種尺寸下都會平衡各行的長度。容器就是這個區段本身。 - 最多兩個操作。 用
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) 並排。低於這個寬度時改為上下排列,文字在前。起始欄的內容靠起始側對齊,適合放表單。這裡用電子郵件欄位和按鈕讓訪客採取行動,下方再以可換行的橫列呈現三項讓人安心的條列清單。
左右分欄
<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,瀏覽器就能在送出前提示使用者還缺什麼。