Tailwind CSS Cheat Sheet - 快速参考指南,收录常用语法、命令与实践。
实用的 Tailwind CSS 常用类速查,覆盖布局、排版、颜色与交互状态,便于快速取用。
text-shadow-2xs~text-shadow-lg:新增文本阴影等级,快速做立体字mask-*:CSS mask 工具类,可用图片或渐变做不规则遮罩drop-shadow-indigo-500 等彩色阴影pointer-coarse:、any-pointer-none:、noscript: 覆盖无 JS 场景@theme 在 CSS 内扩展主题,多数场景无需单独 content 扫描配置container mx-auto px-4:自适应容器 + 水平内边距flex items-center justify-between:水平排列,垂直居中,两端对齐grid grid-cols-3 gap-4:三列网格,统一间距hidden md:block:在中屏以上显示,在小屏隐藏w-full max-w-3xl:宽度 100%,最大宽度限制min-h-screen:最小高度占满视窗p-4 / px-6 / py-2:内边距m-4 / mt-2 / mb-6:外边距space-y-3:同级纵向间距;space-x-2:横向间距gap-3:网格/弹性布局间距rounded / rounded-lg / rounded-full:圆角等级text-sm / text-base / text-xl / text-3xl:字号font-medium / font-semibold / font-bold:字重text-gray-500 / text-slate-700 / text-white:文本色leading-tight / tracking-wide:行高 / 字距text-center / text-left:对齐方式bg-slate-900 text-white:深色背景 + 白字bg-white/80 backdrop-blur:半透明背景 + 毛玻璃bg-gradient-to-r from-indigo-500 via-sky-500 to-emerald-400:渐变背景border border-slate-200:细边框shadow / shadow-lg / shadow-xl:阴影强度text-shadow-sm / text-shadow-md / text-shadow-lg:轻量到强烈的文字阴影drop-shadow-sm / drop-shadow-lg / drop-shadow-indigo-500:普通与彩色投影mask-[url('/mask.svg')] / mask-[radial-gradient(circle,white,transparent)]:图片或渐变遮罩mix-blend-multiply / bg-blend-screen:混合模式backdrop-blur-sm / backdrop-brightness-75:背景滤镜(玻璃态)transition hover:-translate-y-0.5 hover:shadow-lg:悬停提升hover:bg-slate-900 hover:text-white:悬停色focus:outline-none focus:ring-2 focus:ring-sky-400:焦点态描边active:scale-95:按下缩放pointer-coarse:hover:bg-slate-100:仅在触屏等粗指针设备触发noscript:bg-amber-50 text-amber-900:无 JS 环境下的降级样式h-10 / h-12:固定高度aspect-square:正方形overflow-hidden:隐藏溢出object-cover:图片裁剪填充relative / absolute / fixed / sticky top-0:定位模式inset-0:全覆盖z-10 / z-50:层级<!-- 水平分布 -->
<div class="flex items-center justify-between gap-4">
<span>Logo</span>
<div class="flex items-center gap-2">
<button
class="px-3 py-2 rounded-lg bg-slate-900 text-white hover:-translate-y-0.5 transition"
>
Action
</button>
</div>
</div>
<!-- 自适应网格 -->
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4">
<div class="p-4 rounded-xl border border-slate-200 shadow-sm">Card</div>
</div>
sky-500、blue-600、emerald-500slate-700、gray-500、zinc-200slate-900、white、white/70 + backdrop-blurtailwind.config.js 中扩展 colors、spacing、boxShadowcontent 路径中sm < md < lg < xl < 2xlhover:、focus:、active:、disabled:、group-hover:@theme 编写主题令牌@container / container-type: inline-size地址
Level 10b, 144 Edward Street, Brisbane CBD(Headquarter)Level 2, 171 La Trobe St, Melbourne VIC 3000四川省成都市武侯区桂溪街道天府大道中段500号D5东方希望天祥广场B座45A13号Business Hub, 155 Waymouth St, Adelaide SA 5000Disclaimer
JR Academy acknowledges Traditional Owners of Country throughout Australia and recognises the continuing connection to lands, waters and communities. We pay our respect to Aboriginal and Torres Strait Islander cultures; and to Elders past and present. Aboriginal and Torres Strait Islander peoples should be aware that this website may contain images or names of people who have since passed away.
匠人学院网站上的所有内容,包括课程材料、徽标和匠人学院网站上提供的信息,均受澳大利亚政府知识产权法的保护。严禁未经授权使用、销售、分发、复制或修改。违规行为可能会导致法律诉讼。通过访问我们的网站,您同意尊重我们的知识产权。 JR Academy Pty Ltd 保留所有权利,包括专利、商标和版权。任何侵权行为都将受到法律追究。查看用户协议
© 2017-2025 JR Academy Pty Ltd. All rights reserved.
ABN 26621887572