Tailwind CSS文档

使用此交互式备忘单快速查找所有类名和 CSS 属性

Layout

Aspect Ratio

用于控制元素纵横比的实用程序

:-- --
aspect-auto aspect-ratio: auto;
aspect-square aspect-ratio: 1 / 1;
aspect-video aspect-ratio: 16 / 9;

<iframe
  class="w-full aspect-video ..."
  src="https://www.youtube.com/...">
</iframe>

Container

设置最大宽度以匹配当前断点的最小宽度

:-- -- --
container none width: 100%
sm (640px) max-width: 640px;
md (768px) max-width: 768px;
lg (1024px) max-width: 1024px;
xl (1280px) max-width: 1280px;
2xl (1536px) max-width: 1536px;

<div class="md:container md:mx-auto">
  
</div>

Columns

用于控制元素中列数的实用程序

:-- --
columns-1 columns: 1;
columns-2 columns: 2;
columns-3 columns: 3;
columns-4 columns: 4;
columns-5 columns: 5;
columns-6 columns: 6;
columns-7 columns: 7;
columns-8 columns: 8;
columns-9 columns: 9;
columns-10 columns: 10;
columns-11 columns: 11;
columns-12 columns: 12;
columns-auto columns: auto;
columns-3xs columns: 16rem; /256px/
columns-2xs columns: 18rem; /288px/
columns-xs columns: 20rem; /320px/
columns-sm columns: 24rem; /384px/
columns-md columns: 28rem; /448px/
columns-lg columns: 32rem; /512px/
columns-xl columns: 36rem; /576px/
columns-2xl columns: 42rem; /672px/
columns-3xl columns: 48rem; /768px/
columns-4xl columns: 56rem; /896px/
columns-5xl columns: 64rem; /1024px/
columns-6xl columns: 72rem; /1152px/
columns-7xl columns: 80rem; /1280px/

Break After

用于控制列或页面应如何在元素后断开的实用程序

:-- --
break-after-auto break-after: auto;
break-after-avoid break-after: avoid;
break-after-all break-after: all;
break-after-avoid-page break-after: avoid-page;
break-after-page break-after: page;
break-after-left break-after: left;
break-after-right break-after: right;
break-after-column break-after: column;

Break Before

用于控制列或页面在元素之前应如何中断的实用程序

:-- --
break-before-auto break-before: auto;
break-before-avoid break-before: avoid;
break-before-all break-before: all;
break-before-avoid-page break-before: avoid-page;
break-before-page break-before: page;
break-before-left break-before: left;
break-before-right break-before: right;
break-before-column break-before: column;

Break Inside

用于控制列或页面在元素内的拆分方式的实用程序

:-- --
break-inside-auto break-inside: auto;
break-inside-avoid break-inside: avoid;
break-inside-avoid-page break-inside: avoid-page;
break-inside-avoid-column break-inside: avoid-column;

Box Decoration Break

用于控制应如何跨多行、多列或多页呈现元素片段的实用程序

:-- --
box-decoration-clone box-decoration-break: clone;
box-decoration-slice box-decoration-break: slice;

Box Sizing

用于控制浏览器应如何计算元素总大小的实用程序

:-- --
box-border box-sizing: border-box;
box-content box-sizing: content-box;

Display

用于控制元素显示框类型的实用程序

:-- --
block display: block;
inline-block display: inline-block;
inline display: inline;
flex display: flex;
inline-flex display: inline-flex;
table display: table;
inline-table display: inline-table;
table-caption display: table-caption;
table-cell display: table-cell;
table-column display: table-column;
table-column-group display: table-column-group;
table-footer-group display: table-footer-group;
table-header-group display: table-header-group;
table-row-group display: table-row-group;
table-row display: table-row;
flow-root display: flow-root;
grid display: grid;
inline-grid display: inline-grid;
contents display: contents;
list-item display: list-item;
hidden display: none;

Float

用于控制元素周围内容包装的实用程序

Clear

用于控制元素周围内容包装的实用程序

Isolation

用于控制元素是否应显式创建新的堆叠上下文的实用程序

:-- --
isolate isolation: isolate;
isolation-auto isolation: auto;

Object Fit

用于控制如何调整替换元素内容大小的实用程序

Top/Right/Bottom/Left

用于控制定位元素放置的实用程序

Object Position

用于控制替换元素的内容在其容器中的定位方式的实用程序

Overflow

用于控制元素如何处理对于容器来说太大的内容的实用程序

Visibility

用于控制元素可见性的实用程序

Z-index

用于控制元素堆叠顺序的实用程序

Overscroll Behavior

用于控制浏览器到达滚动区域边界时的行为方式的实用程序

Position

用于控制元素在 DOM 中的定位方式的实用程序

Sizing

Width

用于设置元素宽度的实用程序

Min-Width

用于设置元素的最小宽度的实用程序

Max-Width

用于设置元素最大宽度的实用程序

Height

用于设置元素高度的实用程序

Min-Height

用于设置元素的最小高度的实用程序

Max-Height

用于设置元素最大高度的实用程序

Borders

Border Radius

用于控制元素边界半径的实用程序

Border Width

用于控制元素边框宽度的实用程序

Border Color

用于控制元素边框颜色的实用程序

Border Style

用于控制元素边框样式的实用程序

Divide Width

用于控制元素之间的边框宽度的实用程序

Divide Color

用于控制元素之间的边框颜色的实用程序

Divide Style

用于控制元素之间的边框样式的实用程序

Outline Width

用于控制元素轮廓宽度的实用程序

Outline Color

用于控制元素轮廓颜色的实用程序

Outline Style

用于控制元素轮廓样式的实用程序

Outline Offset

用于控制元素轮廓偏移的实用程序

Ring Width

用于创建带有框阴影的轮廓环的实用程序

Ring Color

用于设置轮廓环颜色的实用程序

Ring Offset Width

添加轮廓环时模拟偏移的实用程序

Ring Offset Color

用于设置轮廓环偏移颜色的实用程序

Transitions & Animation

Transition Property

用于控制哪些 CSS 属性转换的实用程序

Transition Duration

用于控制 CSS 过渡持续时间的实用程序

Transition Timing Function

用于控制 CSS 过渡缓动的实用程序

Transition Delay

用于控制 CSS 转换延迟的实用程序

Animation

使用 CSS 动画对元素进行动画处理的实用程序

Tables

Border Collapse

用于控制表格边框是折叠还是分开的实用程序

Border Spacing

用于控制表格边框间距的实用程序

Table Layout

用于控制表布局算法的实用程序

Backgrounds

Background Attachment

用于控制背景图像在滚动时的行为方式的实用程序

Background Color

用于控制元素背景颜色的实用程序

Background Clip

用于控制元素背景边界框的实用程序

Background Origin

用于控制元素背景相对于边框、填充和内容的定位方式的实用程序

Background Position

用于控制元素背景图像位置的实用程序

Background Repeat

用于控制元素背景图像重复的实用程序

Background Size

用于控制元素背景图像的背景大小的实用程序

Gradient Color Stops

用于控制背景渐变色标的实用程序

Background Image

用于控制元素背景图像的实用程序

Spacing

Padding

用于控制元素填充的实用程序

Margin

用于控制元素边距的实用程序

Space Between

用于控制子元素之间空间的实用程序

SVG

Fill

用于样式化 SVG 元素填充的实用程序

Stroke

用于设置 SVG 元素笔划样式的实用程序

Stroke Width

用于设置 SVG 元素笔划宽度样式的实用程序

Typography

Font Family

用于控制元素字体系列的实用程序

Font Size

用于控制元素字体大小的实用程序

Font Smoothing

用于控制元素字体平滑的实用程序

Font Style

用于控制文本样式的实用程序

Font Weight

用于控制元素字体粗细的实用程序

Font Variant Numeric

用于控制数字变体的实用程序

Letter Spacing

用于控制元素的跟踪(字母间距)的实用程序

Line Height

用于控制元素行距(行高)的实用程序

List Style Type

用于控制列表的项目符号/编号样式的实用程序

List Style Position

用于控制列表中项目符号/编号位置的实用程序

Text Align

用于控制文本对齐的实用程序

Text Decoration

用于控制文本装饰的实用程序

Text Color

用于控制元素文本颜色的实用程序

Text Decoration Color

用于控制文本装饰颜色的实用程序

Text Decoration Style

用于控制文本装饰样式的实用程序

Text Decoration Thickness

用于控制文本装饰厚度的实用程序

Text Underline Offset

用于控制文本下划线偏移量的实用程序

Text Transform

用于控制文本转换的实用程序

Text Overflow

用于控制元素中文本溢出的实用程序

Text Indent

用于控制块中文本前显示的空白空间量的实用程序

Vertical Align

用于控制内联或表格单元格框的垂直对齐的实用程序

Whitespace

用于控制元素的空白属性的实用程序

Word Break

用于控制元素中的分词的实用程序

Content

用于控制前后伪元素内容的实用程序

Transforms

Scale

使用变换缩放元素的实用程序

Rotate

使用变换旋转元素的实用程序

Translate

使用 transform 翻译元素的实用程序

Skew

使用变换倾斜元素的实用程序

Transform Origin

用于指定元素转换原点的实用程序

Interactivity

Accent Color

用于控制表单控件强调色的实用程序

Appearance

用于抑制本机表单控件样式的实用程序

Pointer Events

用于控制元素是否响应指针事件的实用程序

Cursor

将鼠标悬停在元素上时控制光标样式的实用程序

Caret Color

用于控制文本输入光标颜色的实用程序

Resize

用于控制如何调整元素大小的实用程序

Scroll Behavior

用于控制元素滚动行为的实用程序

Scroll Snap Align

用于控制元素的滚动对齐对齐的实用程序

Scroll Snap Stop

用于控制您是否可以跳过可能的对齐位置的实用程序

Scroll Snap Type

用于控制在捕捉容器中强制执行捕捉点的严格程度的实用程序

Scroll Margin

用于控制快照容器中项目周围滚动偏移的实用程序

Scroll Padding

用于控制元素在 snap 容器中的滚动偏移的实用程序

Touch Action

用于控制元素如何在触摸屏上滚动和缩放的实用程序

User Select

用于控制用户是否可以选择元素中的文本的实用程序

Will Change

用于优化即将发生变化的元素动画的实用程序

Filters

Blur

将模糊滤镜应用于元素的实用程序

Brightness

将亮度过滤器应用于元素的实用程序

Contrast

用于将对比滤镜应用于元素的实用程序

Drop Shadow

用于将阴影滤镜应用于元素的实用程序

Grayscale

用于将灰度滤镜应用于元素的实用程序

Hue Rotate

用于将色调旋转滤镜应用于元素的实用程序

Invert

用于将反转过滤器应用于元素的实用程序

Saturate

用于将饱和过滤器应用于元素的实用程序

Sepia

将棕褐色滤镜应用于元素的实用程序

Backdrop Blur

将背景模糊滤镜应用于元素的实用程序

Backdrop Brightness

将背景亮度滤镜应用于元素的实用程序

Backdrop Contrast

用于将背景对比度滤镜应用于元素的实用程序

Backdrop Grayscale

用于将背景灰度滤镜应用于元素的实用程序

Backdrop Hue Rotate

将背景色调旋转滤镜应用于元素的实用程序

Backdrop Invert

将背景反转滤镜应用于元素的实用程序

Backdrop Opacity

用于将背景不透明度过滤器应用于元素的实用程序

Backdrop Saturate

用于将背景饱和度滤镜应用于元素的实用程序

Backdrop Sepia

将背景棕褐色过滤器应用于元素的实用程序

Flexbox & Grid

Flex Basis

用于控制弹性项目初始大小的实用程序

Flex Direction

用于控制弹性项目方向的实用程序

Flex Wrap

用于控制弹性项目包装方式的实用程序

Flex

用于控制弹性项目如何增长和收缩的实用程序

Flex Grow

用于控制弹性项目增长方式的实用程序

Flex Shrink

用于控制弹性项目收缩方式的实用程序

Order

用于控制弹性和网格项目顺序的实用程序

Grid Template Columns

用于指定网格布局中的列的实用程序

Grid Column Start/End

用于控制元素如何调整大小和跨网格列放置的实用程序

Grid Template Rows

用于指定网格布局中的行的实用程序

Grid Row Start/End

用于控制元素如何调整大小和跨网格行放置的实用程序

Grid Auto Flow

用于控制网格中元素如何自动放置的实用程序

Grid Auto Columns

用于控制隐式创建的网格列大小的实用程序

Grid Auto Rows

用于控制隐式创建的网格行大小的实用程序

Gap

用于控制网格和 flexbox 项目之间的间距的实用程序

Justify Content

用于控制 flex 和 grid 项目如何沿容器的主轴定位的实用程序

Justify Items

用于控制网格项目如何沿其内联轴对齐的实用程序

Justify Self

用于控制单个网格项目如何沿其内联轴对齐的实用程序

Align Content

用于控制行在多行 flex 和网格容器中的定位方式的实用程序

Align Items

用于控制 flex 和 grid 项目如何沿容器的横轴定位的实用程序

Align Self

用于控制单个弹性或网格项目如何沿其容器的横轴定位的实用程序

Place Content

用于控制内容如何同时对齐和对齐的实用程序

Place Items

用于控制项目如何同时对齐和对齐的实用程序

Place Self

用于控制单个项目如何同时对齐和对齐的实用程序

Accessibility

Screen Readers

用于提高屏幕阅读器可访问性的实用程序