首頁 > web前端 > css教學 > Tailwind CSS 備忘錄

Tailwind CSS 備忘錄

Barbara Streisand
發布: 2024-12-24 19:56:16
原創
576 人瀏覽過

Tailwind CSS Cheatsheet

版面

Utility Class Description
container Centers the content.
block / inline-block Block-level or inline-block.
flex / grid Flexbox or Grid layout.
flex-col / flex-row Flex direction column/row.
items-center Align items vertically.
justify-center Align items horizontally.
gap-1 - gap-12 Spacing between items.

間距

Utility Class Description
m-{size} Margin: mt, mb, ml, mr.
p-{size} Padding: pt, pb, pl, pr.
{size} options 0, px, 1 - 96, etc.

版式

Utility Class Description
text-{size} Font size (e.g., text-sm).
font-bold Bold text.
font-medium Medium text.
font-light Light text.
text-left / text-center / text-right Text alignment.
text-gray-500 Text color.

背景

Utility Class Description
bg-{color} Background color.
bg-gradient-to-r Gradient from left to right.
bg-opacity-{value} Background transparency.

邊框

Utility Class Description
border Default border width.
border-{color} Border color.
rounded / rounded-{size} Rounded corners.

陰影

Utility Class Description
shadow-sm Small shadow.
shadow-md Medium shadow.
shadow-lg Large shadow.
shadow-none No shadow.

尺寸

Utility Class Description
w-{size} / h-{size} Width/Height (full, auto, percentages).
max-w-{size} Maximum width.
min-h-{size} Minimum height.

彈性盒對齊

Utility Class Description
justify-start Align items at the start.
justify-between Space between items.
items-start Align items top.

定位

Utility Class Description
absolute / relative Positioning modes.
top-{value} / left-{value} Offset values.
z-{value} Z-index (stacking).

顏色

Class Examples Description
text-blue-500 Blue text color.
bg-green-300 Green background color.
border-red-400 Red border color.

轉場與動畫

以上是Tailwind CSS 備忘錄的詳細內容。更多資訊請關注PHP中文網其他相關文章!

來源:dev.to
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
作者最新文章
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板