頁面是整份文件一起捲動時使用的外框,包含頁首、主要區域和頁尾。用 page 這個版面配置類別讓外框至少與檢視區等高,其餘細節交給 utility。
頁面
<div class="page bg-surface-base fg-text-body text-sm"> <a class="skip" href="#page-main">Skip to content</a> <header class="navbar" style="--navbar-padding-x: max(1.5rem, calc(50% - 21rem))"> <a class="navbar-brand" href="#"> <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> <circle cx="8" cy="8" r="6" /><path d="M8 4.3333A3.6667 3.6667 0 0 1 8 11.6667Z" fill="currentColor" stroke="none" /> </svg>Atlas </a> <nav class="navbar-nav" aria-label="Main"> <a class="navbar-link" href="#">Product</a> <a class="navbar-link" href="#">Pricing</a> <a class="navbar-link" href="#">Docs</a> <a class="navbar-link" href="#" aria-current="page">Changelog</a> </nav> <div class="navbar-end"> <a class="btn btn-sm" href="#">Sign in</a> <button type="button" class="btn btn-quiet btn-square btn-sm navbar-toggle" popovertarget="page-menu" aria-label="Open the menu"> <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="M3 5.5L13 5.5" /><path d="M3 10.5L13 10.5" /> </svg> </button> <div class="menu menu-end" id="page-menu" popover> <a class="menu-item" href="#">Product</a> <a class="menu-item" href="#">Pricing</a> <a class="menu-item" href="#">Docs</a> <a class="menu-item" href="#" aria-current="page">Changelog</a> </div> </div> </header> <main class="grow(1) w-full max-w(720) mx-auto px-lg py-2xl" id="page-main" tabindex="-1"> <p class="eyebrow">Changelog</p> <h1 class="heading heading-2xl mt-xs">What shipped this month</h1> <p class="lead mt-md"> Every change to Atlas, newest first. Subscribe to the feed to hear about them as they land. </p> <div class="flex flex-col gap-xl mt-2xl"> <article class="flex flex-col gap-xs"> <p class="m(0) text-xs fg-text-muted"> <span class="badge badge-sm">4.2</span> <time class="ml-xs" datetime="2026-10-28">28 October</time> </p> <h2 class="heading">Faster cold builds</h2> <p class="m(0) leading-md"> Dependency caches are now restored before the install step, which removes about forty seconds from a cold build. Nothing to configure. </p> </article> <article class="flex flex-col gap-xs"> <p class="m(0) text-xs fg-text-muted"> <span class="badge badge-sm">4.1</span> <time class="ml-xs" datetime="2026-10-14">14 October</time> </p> <h2 class="heading">Preview comments</h2> <p class="m(0) leading-md"> Leave a comment on any preview deployment, pinned to the element you clicked. Comments follow the element between deployments. </p> </article> <article class="flex flex-col gap-xs"> <p class="m(0) text-xs fg-text-muted"> <span class="badge badge-sm">4.0</span> <time class="ml-xs" datetime="2026-10-01">1 October</time> </p> <h2 class="heading">A new dashboard</h2> <p class="m(0) leading-md"> Projects, domains and usage now live on one page, and every list can be filtered from the keyboard. </p> </article> </div> </main> <footer class="bt(1) bt-solid b-line-hair"> <div class="flex flex-wrap items-center justify-between gap-sm w-full max-w(720) mx-auto px-lg py-lg text-xs fg-text-muted"> <span>© 2026 Atlas Labs</span> <nav class="flex flex-wrap gap-lg" aria-label="Footer"> <a class="link link-quiet" href="#">Privacy</a> <a class="link link-quiet" href="#">Terms</a> <a class="link link-quiet" href="#">Status</a> </nav> </div> </footer></div>import ContrastIcon from '@master/icons-react/native/16/soft/contrast'import MenuIcon from '@master/icons-react/native/16/soft/menu'<div className="page bg-surface-base fg-text-body text-sm"> <a className="skip" href="#page-main">Skip to content</a> <header className="navbar" style={{ '--navbar-padding-x': 'max(1.5rem, calc(50% - 21rem))' } as React.CSSProperties}> <a className="navbar-brand" href="#"><ContrastIcon className="icon" />Atlas</a> <nav className="navbar-nav" aria-label="Main"> <a className="navbar-link" href="#">Product</a> <a className="navbar-link" href="#">Pricing</a> <a className="navbar-link" href="#">Docs</a> <a className="navbar-link" href="#" aria-current="page">Changelog</a> </nav> <div className="navbar-end"> <a className="btn btn-sm" href="#">Sign in</a> <button type="button" className="btn btn-quiet btn-square btn-sm navbar-toggle" popoverTarget="page-menu" aria-label="Open the menu"> <MenuIcon className="icon" /> </button> <div className="menu menu-end" id="page-menu" popover=""> <a className="menu-item" href="#">Product</a> <a className="menu-item" href="#">Pricing</a> <a className="menu-item" href="#">Docs</a> <a className="menu-item" href="#" aria-current="page">Changelog</a> </div> </div> </header> <main className="grow(1) w-full max-w(720) mx-auto px-lg py-2xl" id="page-main" tabIndex={-1}> <p className="eyebrow">Changelog</p> <h1 className="heading heading-2xl mt-xs">What shipped this month</h1> <p className="lead mt-md"> Every change to Atlas, newest first. Subscribe to the feed to hear about them as they land. </p> <div className="flex flex-col gap-xl mt-2xl"> <article className="flex flex-col gap-xs"> <p className="m(0) text-xs fg-text-muted"> <span className="badge badge-sm">4.2</span> <time className="ml-xs" dateTime="2026-10-28">28 October</time> </p> <h2 className="heading">Faster cold builds</h2> <p className="m(0) leading-md"> Dependency caches are now restored before the install step, which removes about forty seconds from a cold build. Nothing to configure. </p> </article> <article className="flex flex-col gap-xs"> <p className="m(0) text-xs fg-text-muted"> <span className="badge badge-sm">4.1</span> <time className="ml-xs" dateTime="2026-10-14">14 October</time> </p> <h2 className="heading">Preview comments</h2> <p className="m(0) leading-md"> Leave a comment on any preview deployment, pinned to the element you clicked. Comments follow the element between deployments. </p> </article> <article className="flex flex-col gap-xs"> <p className="m(0) text-xs fg-text-muted"> <span className="badge badge-sm">4.0</span> <time className="ml-xs" dateTime="2026-10-01">1 October</time> </p> <h2 className="heading">A new dashboard</h2> <p className="m(0) leading-md"> Projects, domains and usage now live on one page, and every list can be filtered from the keyboard. </p> </article> </div> </main> <footer className="bt(1) bt-solid b-line-hair"> <div className="flex flex-wrap items-center justify-between gap-sm w-full max-w(720) mx-auto px-lg py-lg text-xs fg-text-muted"> <span>© 2026 Atlas Labs</span> <nav className="flex flex-wrap gap-lg" aria-label="Footer"> <a className="link link-quiet" href="#">Privacy</a> <a className="link link-quiet" href="#">Terms</a> <a className="link link-quiet" href="#">Status</a> </nav> </div> </footer></div><script> import ContrastIcon from '@master/icons-svelte/native/16/soft/contrast' import MenuIcon from '@master/icons-svelte/native/16/soft/menu'</script><div class="page bg-surface-base fg-text-body text-sm"> <a class="skip" href="#page-main">Skip to content</a> <header class="navbar" style="--navbar-padding-x: max(1.5rem, calc(50% - 21rem))"> <a class="navbar-brand" href="#"><ContrastIcon class="icon" />Atlas</a> <nav class="navbar-nav" aria-label="Main"> <a class="navbar-link" href="#">Product</a> <a class="navbar-link" href="#">Pricing</a> <a class="navbar-link" href="#">Docs</a> <a class="navbar-link" href="#" aria-current="page">Changelog</a> </nav> <div class="navbar-end"> <a class="btn btn-sm" href="#">Sign in</a> <button type="button" class="btn btn-quiet btn-square btn-sm navbar-toggle" popovertarget="page-menu" aria-label="Open the menu"> <MenuIcon class="icon" /> </button> <div class="menu menu-end" id="page-menu" popover> <a class="menu-item" href="#">Product</a> <a class="menu-item" href="#">Pricing</a> <a class="menu-item" href="#">Docs</a> <a class="menu-item" href="#" aria-current="page">Changelog</a> </div> </div> </header> <main class="grow(1) w-full max-w(720) mx-auto px-lg py-2xl" id="page-main" tabindex="-1"> <p class="eyebrow">Changelog</p> <h1 class="heading heading-2xl mt-xs">What shipped this month</h1> <p class="lead mt-md"> Every change to Atlas, newest first. Subscribe to the feed to hear about them as they land. </p> <div class="flex flex-col gap-xl mt-2xl"> <article class="flex flex-col gap-xs"> <p class="m(0) text-xs fg-text-muted"> <span class="badge badge-sm">4.2</span> <time class="ml-xs" datetime="2026-10-28">28 October</time> </p> <h2 class="heading">Faster cold builds</h2> <p class="m(0) leading-md"> Dependency caches are now restored before the install step, which removes about forty seconds from a cold build. Nothing to configure. </p> </article> <article class="flex flex-col gap-xs"> <p class="m(0) text-xs fg-text-muted"> <span class="badge badge-sm">4.1</span> <time class="ml-xs" datetime="2026-10-14">14 October</time> </p> <h2 class="heading">Preview comments</h2> <p class="m(0) leading-md"> Leave a comment on any preview deployment, pinned to the element you clicked. Comments follow the element between deployments. </p> </article> <article class="flex flex-col gap-xs"> <p class="m(0) text-xs fg-text-muted"> <span class="badge badge-sm">4.0</span> <time class="ml-xs" datetime="2026-10-01">1 October</time> </p> <h2 class="heading">A new dashboard</h2> <p class="m(0) leading-md"> Projects, domains and usage now live on one page, and every list can be filtered from the keyboard. </p> </article> </div> </main> <footer class="bt(1) bt-solid b-line-hair"> <div class="flex flex-wrap items-center justify-between gap-sm w-full max-w(720) mx-auto px-lg py-lg text-xs fg-text-muted"> <span>© 2026 Atlas Labs</span> <nav class="flex flex-wrap gap-lg" aria-label="Footer"> <a class="link link-quiet" href="#">Privacy</a> <a class="link link-quiet" href="#">Terms</a> <a class="link link-quiet" href="#">Status</a> </nav> </div> </footer></div><script setup>import ContrastIcon from '@master/icons-vue/native/16/soft/contrast'import MenuIcon from '@master/icons-vue/native/16/soft/menu'</script><template> <div class="page bg-surface-base fg-text-body text-sm"> <a class="skip" href="#page-main">Skip to content</a> <header class="navbar" style="--navbar-padding-x: max(1.5rem, calc(50% - 21rem))"> <a class="navbar-brand" href="#"><ContrastIcon class="icon" />Atlas</a> <nav class="navbar-nav" aria-label="Main"> <a class="navbar-link" href="#">Product</a> <a class="navbar-link" href="#">Pricing</a> <a class="navbar-link" href="#">Docs</a> <a class="navbar-link" href="#" aria-current="page">Changelog</a> </nav> <div class="navbar-end"> <a class="btn btn-sm" href="#">Sign in</a> <button type="button" class="btn btn-quiet btn-square btn-sm navbar-toggle" popovertarget="page-menu" aria-label="Open the menu"> <MenuIcon class="icon" /> </button> <div class="menu menu-end" id="page-menu" popover> <a class="menu-item" href="#">Product</a> <a class="menu-item" href="#">Pricing</a> <a class="menu-item" href="#">Docs</a> <a class="menu-item" href="#" aria-current="page">Changelog</a> </div> </div> </header> <main class="grow(1) w-full max-w(720) mx-auto px-lg py-2xl" id="page-main" tabindex="-1"> <p class="eyebrow">Changelog</p> <h1 class="heading heading-2xl mt-xs">What shipped this month</h1> <p class="lead mt-md"> Every change to Atlas, newest first. Subscribe to the feed to hear about them as they land. </p> <div class="flex flex-col gap-xl mt-2xl"> <article class="flex flex-col gap-xs"> <p class="m(0) text-xs fg-text-muted"> <span class="badge badge-sm">4.2</span> <time class="ml-xs" datetime="2026-10-28">28 October</time> </p> <h2 class="heading">Faster cold builds</h2> <p class="m(0) leading-md"> Dependency caches are now restored before the install step, which removes about forty seconds from a cold build. Nothing to configure. </p> </article> <article class="flex flex-col gap-xs"> <p class="m(0) text-xs fg-text-muted"> <span class="badge badge-sm">4.1</span> <time class="ml-xs" datetime="2026-10-14">14 October</time> </p> <h2 class="heading">Preview comments</h2> <p class="m(0) leading-md"> Leave a comment on any preview deployment, pinned to the element you clicked. Comments follow the element between deployments. </p> </article> <article class="flex flex-col gap-xs"> <p class="m(0) text-xs fg-text-muted"> <span class="badge badge-sm">4.0</span> <time class="ml-xs" datetime="2026-10-01">1 October</time> </p> <h2 class="heading">A new dashboard</h2> <p class="m(0) leading-md"> Projects, domains and usage now live on one page, and every list can be filtered from the keyboard. </p> </article> </div> </main> <footer class="bt(1) bt-solid b-line-hair"> <div class="flex flex-wrap items-center justify-between gap-sm w-full max-w(720) mx-auto px-lg py-lg text-xs fg-text-muted"> <span>© 2026 Atlas Labs</span> <nav class="flex flex-wrap gap-lg" aria-label="Footer"> <a class="link link-quiet" href="#">Privacy</a> <a class="link link-quiet" href="#">Terms</a> <a class="link link-quiet" href="#">Status</a> </nav> </div> </footer> </div></template>捲動頁面時,內容一捲到導覽列背後,導覽列就會呈現材質效果。
#建構方式
- 在外框套用
page。 外框採垂直排列,最小高度為100dvh。這個動態檢視區單位會隨手機瀏覽器工具列的顯示與隱藏而調整,讓外框的最小高度貼合目前可見的範圍,避免因工具列變動而超出或留白。這裡只有這項設定無法用 utility 表達。 - 在主要區域套用
grow(1)。 主要區域會填滿剩餘空間,讓內容較少的頁面也能把頁尾留在底部。 - 只限制內容的行寬,保留版面區域的寬度。 頁首和頁尾都占滿寬度。主要區域與頁尾內的內容共用
max-w(720) mx-auto px-lg,讓兩側邊緣對齊。導覽列以--navbar-padding-x: max(1.5rem, calc(50% - 21rem))對齊同一條邊線,也就是從中央往外半個寬度。索引頁可用更寬的設定,閱讀頁則可沿用這個寬度。 - 表面樣式來自元件。 頂端的列是導覽列,本身就會黏附;頁尾上方的細線則用邊框 utility 繪製。
#短頁面
內容比檢視區矮時,主要區域仍會填滿剩餘空間,讓頁尾留在底部。在主要區域套用 flex items-center justify-center,即可將少量內容置中。
短頁面
<div class="page bg-surface-base fg-text-body text-sm"> <a class="skip" href="#page-main-short">Skip to content</a> <header class="navbar" style="--navbar-padding-x: 1.5rem"> <a class="navbar-brand" href="#"> <svg class="icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> <circle cx="8" cy="8" r="6" /><path d="M8 4.3333A3.6667 3.6667 0 0 1 8 11.6667Z" fill="currentColor" stroke="none" /> </svg>Atlas </a> <nav class="navbar-nav" aria-label="Main"> <a class="navbar-link" href="#">Product</a> <a class="navbar-link" href="#">Pricing</a> <a class="navbar-link" href="#">Docs</a> <a class="navbar-link" href="#" aria-current="page">Changelog</a> </nav> <div class="navbar-end"> <a class="btn btn-sm" href="#">Sign in</a> <button type="button" class="btn btn-quiet btn-square btn-sm navbar-toggle" popovertarget="page-menu-short" aria-label="Open the menu"> <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="M3 5.5L13 5.5" /><path d="M3 10.5L13 10.5" /> </svg> </button> <div class="menu menu-end" id="page-menu-short" popover> <a class="menu-item" href="#">Product</a> <a class="menu-item" href="#">Pricing</a> <a class="menu-item" href="#">Docs</a> <a class="menu-item" href="#" aria-current="page">Changelog</a> </div> </div> </header> <main class="grow(1) flex items-center justify-center p-lg" id="page-main-short" tabindex="-1"> <div class="empty"> <div class="icon-frame empty-media" aria-hidden="true"> <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="M10 1.6667C5 5.8333 4.5833 10.8333 7.0833 15.4167H12.9167C15.4167 10.8333 15 5.8333 10 1.6667Z" /><circle cx="10" cy="8.3333" r="1" fill="currentColor" stroke="none" /><path d="M12.5059 15.4167Q12.6134 15.5471 12.7721 15.6266L15.7283 17.1047A0.8249 0.8249 0 0 0 16.9109 16.5023L17.6842 11.8631A0.8257 0.8257 0 0 0 17.4914 11.1839L14.9083 8.2317A0.8274 0.8274 0 0 0 14.1839 7.9561C14.3744 8.793 14.4431 9.6377 14.3995 10.4832L14.5438 9.7135L16.4181 11.8557L15.7727 15.7292L13.6179 14.6519L13.9005 13.1446C13.6551 13.9094 13.3247 14.6686 12.9167 15.4167H12.5059ZM5.8161 7.9561A0.8199 0.8199 0 0 0 5.0917 8.2318L2.5086 11.1839A0.8257 0.8257 0 0 0 2.3158 11.8631L3.089 16.5023A0.825 0.825 0 0 0 4.2717 17.1047L7.2279 15.6266Q7.3866 15.5471 7.4941 15.4167H7.0833C6.6753 14.6686 6.3449 13.9094 6.0995 13.1446L6.3821 14.6519L4.2274 15.7292L3.5818 11.8557L5.4562 9.7135L5.6005 10.4832C5.5569 9.6377 5.6256 8.793 5.8161 7.9561Z" fill="currentColor" stroke="none" fill-rule="evenodd" /><path d="M8.3333 18.75L11.6667 18.75" /> </svg> </div> <h1 class="empty-title">Nothing has shipped yet</h1> <p class="empty-description">The first entry appears here with the first release.</p> <div class="empty-actions"> <button type="button" class="btn btn-sm">Subscribe to the feed</button> </div> </div> </main> <footer class="bt(1) bt-solid b-line-hair"> <div class="flex flex-wrap items-center justify-between gap-sm w-full max-w(720) mx-auto px-lg py-lg text-xs fg-text-muted"> <span>© 2026 Atlas Labs</span> <nav class="flex flex-wrap gap-lg" aria-label="Footer"> <a class="link link-quiet" href="#">Privacy</a> <a class="link link-quiet" href="#">Terms</a> <a class="link link-quiet" href="#">Status</a> </nav> </div> </footer></div>import ContrastIcon from '@master/icons-react/native/16/soft/contrast'import MenuIcon from '@master/icons-react/native/16/soft/menu'import RocketIcon from '@master/icons-react/native/20/soft/rocket'<div className="page bg-surface-base fg-text-body text-sm"> <a className="skip" href="#page-main-short">Skip to content</a> <header className="navbar" style={{ '--navbar-padding-x': '1.5rem' } as React.CSSProperties}> <a className="navbar-brand" href="#"><ContrastIcon className="icon" />Atlas</a> <nav className="navbar-nav" aria-label="Main"> <a className="navbar-link" href="#">Product</a> <a className="navbar-link" href="#">Pricing</a> <a className="navbar-link" href="#">Docs</a> <a className="navbar-link" href="#" aria-current="page">Changelog</a> </nav> <div className="navbar-end"> <a className="btn btn-sm" href="#">Sign in</a> <button type="button" className="btn btn-quiet btn-square btn-sm navbar-toggle" popoverTarget="page-menu-short" aria-label="Open the menu"> <MenuIcon className="icon" /> </button> <div className="menu menu-end" id="page-menu-short" popover=""> <a className="menu-item" href="#">Product</a> <a className="menu-item" href="#">Pricing</a> <a className="menu-item" href="#">Docs</a> <a className="menu-item" href="#" aria-current="page">Changelog</a> </div> </div> </header> <main className="grow(1) flex items-center justify-center p-lg" id="page-main-short" tabIndex={-1}> <div className="empty"> <div className="icon-frame empty-media" aria-hidden="true"> <RocketIcon className="icon" /> </div> <h1 className="empty-title">Nothing has shipped yet</h1> <p className="empty-description">The first entry appears here with the first release.</p> <div className="empty-actions"> <button type="button" className="btn btn-sm">Subscribe to the feed</button> </div> </div> </main> <footer className="bt(1) bt-solid b-line-hair"> <div className="flex flex-wrap items-center justify-between gap-sm w-full max-w(720) mx-auto px-lg py-lg text-xs fg-text-muted"> <span>© 2026 Atlas Labs</span> <nav className="flex flex-wrap gap-lg" aria-label="Footer"> <a className="link link-quiet" href="#">Privacy</a> <a className="link link-quiet" href="#">Terms</a> <a className="link link-quiet" href="#">Status</a> </nav> </div> </footer></div><script> import ContrastIcon from '@master/icons-svelte/native/16/soft/contrast' import MenuIcon from '@master/icons-svelte/native/16/soft/menu' import RocketIcon from '@master/icons-svelte/native/20/soft/rocket'</script><div class="page bg-surface-base fg-text-body text-sm"> <a class="skip" href="#page-main-short">Skip to content</a> <header class="navbar" style="--navbar-padding-x: 1.5rem"> <a class="navbar-brand" href="#"><ContrastIcon class="icon" />Atlas</a> <nav class="navbar-nav" aria-label="Main"> <a class="navbar-link" href="#">Product</a> <a class="navbar-link" href="#">Pricing</a> <a class="navbar-link" href="#">Docs</a> <a class="navbar-link" href="#" aria-current="page">Changelog</a> </nav> <div class="navbar-end"> <a class="btn btn-sm" href="#">Sign in</a> <button type="button" class="btn btn-quiet btn-square btn-sm navbar-toggle" popovertarget="page-menu-short" aria-label="Open the menu"> <MenuIcon class="icon" /> </button> <div class="menu menu-end" id="page-menu-short" popover> <a class="menu-item" href="#">Product</a> <a class="menu-item" href="#">Pricing</a> <a class="menu-item" href="#">Docs</a> <a class="menu-item" href="#" aria-current="page">Changelog</a> </div> </div> </header> <main class="grow(1) flex items-center justify-center p-lg" id="page-main-short" tabindex="-1"> <div class="empty"> <div class="icon-frame empty-media" aria-hidden="true"><RocketIcon class="icon" /></div> <h1 class="empty-title">Nothing has shipped yet</h1> <p class="empty-description">The first entry appears here with the first release.</p> <div class="empty-actions"> <button type="button" class="btn btn-sm">Subscribe to the feed</button> </div> </div> </main> <footer class="bt(1) bt-solid b-line-hair"> <div class="flex flex-wrap items-center justify-between gap-sm w-full max-w(720) mx-auto px-lg py-lg text-xs fg-text-muted"> <span>© 2026 Atlas Labs</span> <nav class="flex flex-wrap gap-lg" aria-label="Footer"> <a class="link link-quiet" href="#">Privacy</a> <a class="link link-quiet" href="#">Terms</a> <a class="link link-quiet" href="#">Status</a> </nav> </div> </footer></div><script setup>import ContrastIcon from '@master/icons-vue/native/16/soft/contrast'import MenuIcon from '@master/icons-vue/native/16/soft/menu'import RocketIcon from '@master/icons-vue/native/20/soft/rocket'</script><template> <div class="page bg-surface-base fg-text-body text-sm"> <a class="skip" href="#page-main-short">Skip to content</a> <header class="navbar" style="--navbar-padding-x: 1.5rem"> <a class="navbar-brand" href="#"><ContrastIcon class="icon" />Atlas</a> <nav class="navbar-nav" aria-label="Main"> <a class="navbar-link" href="#">Product</a> <a class="navbar-link" href="#">Pricing</a> <a class="navbar-link" href="#">Docs</a> <a class="navbar-link" href="#" aria-current="page">Changelog</a> </nav> <div class="navbar-end"> <a class="btn btn-sm" href="#">Sign in</a> <button type="button" class="btn btn-quiet btn-square btn-sm navbar-toggle" popovertarget="page-menu-short" aria-label="Open the menu"> <MenuIcon class="icon" /> </button> <div class="menu menu-end" id="page-menu-short" popover> <a class="menu-item" href="#">Product</a> <a class="menu-item" href="#">Pricing</a> <a class="menu-item" href="#">Docs</a> <a class="menu-item" href="#" aria-current="page">Changelog</a> </div> </div> </header> <main class="grow(1) flex items-center justify-center p-lg" id="page-main-short" tabindex="-1"> <div class="empty"> <div class="icon-frame empty-media" aria-hidden="true"><RocketIcon class="icon" /></div> <h1 class="empty-title">Nothing has shipped yet</h1> <p class="empty-description">The first entry appears here with the first release.</p> <div class="empty-actions"> <button type="button" class="btn btn-sm">Subscribe to the feed</button> </div> </div> </main> <footer class="bt(1) bt-solid b-line-hair"> <div class="flex flex-wrap items-center justify-between gap-sm w-full max-w(720) mx-auto px-lg py-lg text-xs fg-text-muted"> <span>© 2026 Atlas Labs</span> <nav class="flex flex-wrap gap-lg" aria-label="Footer"> <a class="link link-quiet" href="#">Privacy</a> <a class="link link-quiet" href="#">Terms</a> <a class="link link-quiet" href="#">Status</a> </nav> </div> </footer> </div></template>#可以用它建構什麼
網站的大多數頁面,都是在這個外框的主要區域中放入其他內容。
| 頁面 | 主要區域的內容 |
|---|---|
| 文章、部落格文章、變更紀錄 | 可延伸欄:一條閱讀欄,圖片或表格可以延伸到欄外 |
| 一旁附有目錄的長篇文章 | 文件頁面,它另外加上導覽和目錄 |
| 搜尋、資源目錄 | 搜尋結果頁面:篩選條件位於它們找到的結果旁邊 |
| 登陸頁 | 一個接一個的區塊:主視覺、功能特色、定價、行動呼籲 |
| 登入、錯誤 | 中央的一張卡片:置中版面 |
#無障礙
- 使用地標元素
<header>、<main>和<footer>,各放一個,並為每個<nav>加上標籤。 - 頁面第一個元素是通往主要區域的略過連結。在主要區域加上
tabindex="-1",焦點就會隨跳轉移過去。鍵盤使用者按一次鍵即可略過頁首。 - 黏附在頂端的頁首會蓋住頁面上緣。將根元素的
scroll-padding-top設為頁首高度,讓連結跳到標題時避開頁首。也可以在連結指向的標題上套用 flash,讓各標題在跳轉後都能避開頁首。
#類別
| 類別 | 說明 |
|---|---|
page | 外框為直向排列,至少與檢視區同高,以 dvh 計量。外框本身不繪製任何內容 |
#相關項目
- 導覽列位於頁面頂端的導覽列,頁面內容捲到它下方時才會顯示背景。
- 略過連結頁面上的第一個連結,取得焦點時才顯示,可略過導覽並跳到內容。
- 標題以頁面的高對比文字色呈現標題,搭配上方的前導標籤與下方的引言。
- 連結沿用句子的文字顏色,帶使用者前往其他位置。
- 選單在按鈕旁的彈出視窗中列出可執行的操作。
- 空狀態檢視畫面尚無內容可顯示時呈現的狀態。