行动号召是页面最后提出的请求。说清理由后,再给访客一次采取行动的机会。它使用独立的表面,让读者看出页面在此收尾。这里使用墨色面板,这是页面上最醒目的表面,专门留给这一用途。
行动号召
<section class="container-inline px-lg py-4xl" aria-labelledby="cta-title"> <div class="sheet sheet-inverse flex flex-col items-center gap-lg max-w(1040) mx-auto px-lg py-3xl text-center"> <h2 class="heading heading-2xl fg-text-inverse max-w(560)" id="cta-title"> Your next push could already be live. </h2> <p class="lead max-w(480) fg-text-inverse"> Connect a repository and deploy in under a minute. Free for personal projects. </p> <div class="flex flex-wrap justify-center gap-sm"> <a class="btn btn-lg" href="#">Start deploying</a> <a class="btn btn-quiet btn-lg fg-text-inverse" href="#"> Talk to sales<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></section>import ArrowRightIcon from '@master/icons-react/native/20/soft/arrow-right'<section className="container-inline px-lg py-4xl" aria-labelledby="cta-title"> <div className="sheet sheet-inverse flex flex-col items-center gap-lg max-w(1040) mx-auto px-lg py-3xl text-center"> <h2 className="heading heading-2xl fg-text-inverse max-w(560)" id="cta-title"> Your next push could already be live. </h2> <p className="lead max-w(480) fg-text-inverse"> Connect a repository and deploy in under a minute. Free for personal projects. </p> <div className="flex flex-wrap justify-center gap-sm"> <a className="btn btn-lg" href="#">Start deploying</a> <a className="btn btn-quiet btn-lg fg-text-inverse" href="#"> Talk to sales<ArrowRightIcon className="icon" /> </a> </div> </div></section><script> import ArrowRightIcon from '@master/icons-svelte/native/20/soft/arrow-right'</script><section class="container-inline px-lg py-4xl" aria-labelledby="cta-title"> <div class="sheet sheet-inverse flex flex-col items-center gap-lg max-w(1040) mx-auto px-lg py-3xl text-center"> <h2 class="heading heading-2xl fg-text-inverse max-w(560)" id="cta-title"> Your next push could already be live. </h2> <p class="lead max-w(480) fg-text-inverse"> Connect a repository and deploy in under a minute. Free for personal projects. </p> <div class="flex flex-wrap justify-center gap-sm"> <a class="btn btn-lg" href="#">Start deploying</a> <a class="btn btn-quiet btn-lg fg-text-inverse" href="#"> Talk to sales<ArrowRightIcon class="icon" /> </a> </div> </div></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="cta-title"> <div class="sheet sheet-inverse flex flex-col items-center gap-lg max-w(1040) mx-auto px-lg py-3xl text-center"> <h2 class="heading heading-2xl fg-text-inverse max-w(560)" id="cta-title"> Your next push could already be live. </h2> <p class="lead max-w(480) fg-text-inverse"> Connect a repository and deploy in under a minute. Free for personal projects. </p> <div class="flex flex-wrap justify-center gap-sm"> <a class="btn btn-lg" href="#">Start deploying</a> <a class="btn btn-quiet btn-lg fg-text-inverse" href="#"> Talk to sales<ArrowRightIcon class="icon" /> </a> </div> </div> </section></template>区块提供可直接复制的标记,沿用页面的文字颜色和字号。预览在 body 上设置 fg-text-body text-sm。每个区块都是尺寸容器,会根据自身宽度重排。
#区块构成
sheet sheet-inverse。 Moonstone 中呈墨色,Obsidian 中呈珍珠色,光照效果与主按钮相同。每页只用一个。- 文字使用反相前景色。 标题和引导语使用
fg-text-inverse,工具类放在标题自身的颜色设置之后。 - 使用默认按钮承载操作。 在墨色表面上,普通凸起按钮是最亮的元素。主按钮则会让墨色叠在墨色上。
- 一句话配一个操作,再为还没准备好的访客提供一个低调的次要操作。
#低调样式
如果页面已经有醒目的收尾,或每页都重复同一个行动号召,就使用常规材质。在托盘中放入面板,文字放在起始端,按钮放在末端。横向空间不足时,flex flex-wrap justify-between 会把按钮移到文字下方。
低调样式
<section class="container-inline px-lg py-4xl" aria-labelledby="cta-quiet-title"> <div class="tray max-w(1040) mx-auto"> <div class="sheet flex flex-wrap items-center justify-between gap-lg p-xl"> <div class="flex flex-col gap-xs"> <h2 class="heading heading-lg" id="cta-quiet-title">Ready when you are.</h2> <p class="m(0) leading-md">Deploy your first project in under a minute. No card needed.</p> </div> <div class="flex flex-wrap gap-sm"> <a class="btn btn-primary" href="#">Start deploying</a> <a class="btn" href="#">Read the docs</a> </div> </div> </div></section><section className="container-inline px-lg py-4xl" aria-labelledby="cta-quiet-title"> <div className="tray max-w(1040) mx-auto"> <div className="sheet flex flex-wrap items-center justify-between gap-lg p-xl"> <div className="flex flex-col gap-xs"> <h2 className="heading heading-lg" id="cta-quiet-title">Ready when you are.</h2> <p className="m(0) leading-md"> Deploy your first project in under a minute. No card needed. </p> </div> <div className="flex flex-wrap gap-sm"> <a className="btn btn-primary" href="#">Start deploying</a> <a className="btn" href="#">Read the docs</a> </div> </div> </div></section><section class="container-inline px-lg py-4xl" aria-labelledby="cta-quiet-title"> <div class="tray max-w(1040) mx-auto"> <div class="sheet flex flex-wrap items-center justify-between gap-lg p-xl"> <div class="flex flex-col gap-xs"> <h2 class="heading heading-lg" id="cta-quiet-title">Ready when you are.</h2> <p class="m(0) leading-md">Deploy your first project in under a minute. No card needed.</p> </div> <div class="flex flex-wrap gap-sm"> <a class="btn btn-primary" href="#">Start deploying</a> <a class="btn" href="#">Read the docs</a> </div> </div> </div></section><template> <section class="container-inline px-lg py-4xl" aria-labelledby="cta-quiet-title"> <div class="tray max-w(1040) mx-auto"> <div class="sheet flex flex-wrap items-center justify-between gap-lg p-xl"> <div class="flex flex-col gap-xs"> <h2 class="heading heading-lg" id="cta-quiet-title">Ready when you are.</h2> <p class="m(0) leading-md"> Deploy your first project in under a minute. No card needed. </p> </div> <div class="flex flex-wrap gap-sm"> <a class="btn btn-primary" href="#">Start deploying</a> <a class="btn" href="#">Read the docs</a> </div> </div> </div> </section></template>#带输入字段
如果操作需要填写电子邮箱地址,将输入字段和对应的按钮放在同一行,并允许换行。grow(1) basis(200) 让输入字段以 200px 为伸缩基准,并扩展以填满行内剩余空间。按这一基准排不下按钮时,按钮就会换到下一行。
带输入字段
<section class="container-inline px-lg py-4xl" aria-labelledby="cta-form-title"> <div class="flex flex-col items-center gap-lg max-w(520) mx-auto text-center"> <h2 class="heading heading-2xl" id="cta-form-title">One email when something ships.</h2> <p class="lead">The changelog, about twice a month. Nothing else, and one click to stop.</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">Subscribe</button> </form> </div></section><section className="container-inline px-lg py-4xl" aria-labelledby="cta-form-title"> <div className="flex flex-col items-center gap-lg max-w(520) mx-auto text-center"> <h2 className="heading heading-2xl" id="cta-form-title">One email when something ships.</h2> <p className="lead">The changelog, about twice a month. Nothing else, and one click to stop.</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">Subscribe</button> </form> </div></section><section class="container-inline px-lg py-4xl" aria-labelledby="cta-form-title"> <div class="flex flex-col items-center gap-lg max-w(520) mx-auto text-center"> <h2 class="heading heading-2xl" id="cta-form-title">One email when something ships.</h2> <p class="lead">The changelog, about twice a month. Nothing else, and one click to stop.</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">Subscribe</button> </form> </div></section><template> <section class="container-inline px-lg py-4xl" aria-labelledby="cta-form-title"> <div class="flex flex-col items-center gap-lg max-w(520) mx-auto text-center"> <h2 class="heading heading-2xl" id="cta-form-title">One email when something ships.</h2> <p class="lead">The changelog, about twice a month. Nothing else, and one click to stop.</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">Subscribe</button> </form> </div> </section></template>#无障碍
- 反相面板在两种配色方案中都能保持文字与背景之间的充分对比,因为面板的墨色和文字颜色采用主题自带的一对反相配色。
- 输入字段需要无障碍名称。这里使用
aria-label="Email",空间允许时,最好使用可见标签。 - 说清点击后会发生什么。“开始部署”明确承诺了下一步,“提交”没有说明接下来会怎样。