Typography
Utilities for controlling the size of tab characters.
| Class | Styles |
|---|---|
tab-<number> | tab-size: <number>; |
tab-(<custom-property>) | tab-size: var(<custom-property>); |
tab-[<value>] | tab-size: <value>; |
Use tab-<number> utilities like tab-2 and tab-8 to control the size of tab characters:
function indent() { return 'tabbed';}function indent() { return 'tabbed';}<pre class="tab-2 ...">function indent() { 	return 'tabbed' }</pre><pre class="tab-8 ...">function indent() { 	return 'tabbed' }</pre>Use the tab-[<value>] syntax to set the tab size based on a completely custom value:
<pre class="tab-[12px] ..."> <!-- ... --></pre>For CSS variables, you can also use the tab-(<custom-property>) syntax:
<pre class="tab-(--my-tab-size) ..."> <!-- ... --></pre>This is just a shorthand for tab-[var(<custom-property>)] that adds the var() function for you automatically.
Prefix a tab-size utility with a breakpoint variant like md: to only apply the utility at medium screen sizes and above:
<pre class="tab-4 md:tab-8 ..."> <!-- ... --></pre>Learn more about using variants in the variants documentation.
Tailwind CSS 中文网(本网站)的目标是为中文开发者提供准确、及时的 Tailwind CSS 中文文档
Tailwind CSS 中文文档由本网站维护人员共同翻译,采用 MIT 开源协议发布
本网站与 tailwindcss.com 及 Tailwind Labs Inc. 并无从属关系
Tailwind 商标由 Tailwind Labs Inc. 所有
京ICP备15031610号-106