tab-size
Baseline
Widely available
This feature is well established and works across many devices and browser versions. Itâs been available across browsers since 2021ë 8ì.
CSS tab-size ìì±ì í 문ì(U+0009)ì ëë¹ë¥¼ ì¡°ì í©ëë¤.
구문
css
/* <integer> ê° */
tab-size: 4;
tab-size: 0;
/* <length> ê° */
tab-size: 10px;
tab-size: 2em;
/* ì ì ê° */
tab-size: inherit;
tab-size: initial;
tab-size: unset;
ê°
íì ì ì
| ì´ê¸°ê° | 8 |
|---|---|
| ì ì©ëì | block containers |
| ìì | yes |
| ê³ì° ê° | the specified integer or an absolute length |
| Animation type | a length |
íì 구문
tab-size =
<number [0,â]> |
<length [0,â]>
ìì
>ê¸ì ìë¡ ì ì
css
pre {
tab-size: 4; /* Set tab size to 4 characters wide */
}
í ì ê±°
css
pre {
tab-size: 0; /* Remove indentation */
}
기본 í¬ê¸°ì ë¹êµ
ë¤ì ìì ë 기본 í í¬ê¸°ë¥¼ ì¬ì©ì ì§ì í í¬ê¸°ì ë¹êµí©ëë¤. white-space ìì±ì preë¡ ì¤ì í´ì í 문ìê° ì íì§ ìëë¡ íìµëë¤.
HTML
html
<p>no tab</p>
<p>	default tab size of 8 characters wide</p>
<p class="custom">	custom tab size of 3 characters wide</p>
<p> 3 spaces, equivalent to the custom tab size</p>
CSS
css
p {
white-space: pre;
}
.custom {
tab-size: 3;
-moz-tab-size: 3;
}
ê²°ê³¼
ëª ì¸
| Specification |
|---|
| CSS Text Module Level 3 > # tab-size-property > |
ë¸ë¼ì°ì í¸íì±
ê°ì´ 보기
- Controlling size of a tab character (U+0009), Anne van Kesterenì´ CSSWGì ë³´ë¸ ì´ë©ì¼.