仪表盘控件
本课属于 Coddy Tailwind CSS 学习旅程的“基础知识”单元。第 54 课,共 55 课。
使用提供的文件构建工作室仪表板的这一阶段。保留之前步骤中的所有内容。“Export summary”按钮在正常状态下必须完全不透明,悬停时不透明度为 60%。为它设置清晰可见的 2 像素黑色实线焦点轮廓。禁用的“Archive unavailable”控件必须保持禁用状态,并以 40% 的不透明度显示。保留这两个标签以及提供的 Theme 控件。
挑战
困难保留前面步骤中的所有内容。“Export summary”按钮在正常状态下必须完全不透明,悬停时不透明度为 60%。为它添加清晰可见的 2 像素黑色实线焦点轮廓。“Archive unavailable”控件必须保持禁用状态,并以 40% 的不透明度显示。保留这两个标签和提供的 Theme 控件。
保留提供的内容和元素 ID。编辑 HTML 工具类或按要求修改 CSS。编辑后,点击“Run preview”刷新预览,然后使用“Check/Run code”检查你的作品。
亲手试试
<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Practice studio</title><link rel="stylesheet" href="./styles.css"></head><body>
<main id="dashboard" class="w-full max-w-4xl mx-auto p-6 bg-white text-black rounded-xl">
<header id="header" class="flex flex-col sm:flex-row justify-between gap-4"><h1 id="heading" class="text-2xl font-bold">Studio overview</h1><button id="theme-toggle" class="px-3 py-2 border rounded-lg">Theme</button></header>
<div id="layout" class="grid grid-cols-1 lg:grid-cols-[160px_1fr] gap-6">
<nav id="sidebar" class="hidden lg:block" aria-label="Dashboard sections"><a class="block px-2 py-2" href="#stats">Overview</a><a class="block px-2 py-2" href="#activity">Activity</a></nav>
<section><div id="stats" class="grid grid-cols-1 md:grid-cols-3 gap-4">
<article id="visits" class="p-4 border border-black rounded-lg"><h2>Visits</h2><p>240</p></article>
<article id="bookings" class="p-4 border border-black rounded-lg"><h2>Bookings</h2><p>18</p></article>
<article id="rating" class="p-4 border border-black rounded-lg"><h2>Rating</h2><p>4.8</p></article>
</div><section id="activity"><h2>Recent activity</h2><p>New pottery booking</p></section>
<button id="export" class="mr-4 mt-4 px-3 py-2 border rounded-lg ">Export summary</button><button id="archive" disabled class="mt-4 px-3 py-2 border rounded-lg ">Archive unavailable</button>
</section>
</div>
</main>
<script src="./controls.js"></script>
</body></html>
这节课包含一个小测验。开始学习即可作答,并记录你的进度。