是否可以更改选项卡的大小?例如,当您有 <textarea>
时,如何才能使选项卡的尺寸变小?
据我所知,空格是一列,制表符通常是 4 列。如何使选项卡只占用 3 列字符空间?
Normal tab size: | |
Wanted tab size: | |
这将有助于更清晰地显示代码。此外,它还会使(导出的)文件大小保持较小(因为 1 个 Tab 字符小于 3 个 Space 字符)。
我不知道从哪里开始,也没有在互联网上找到任何东西。因此,我们将非常感谢您的每一次帮助。
最佳答案
我想您可能正在寻找 tab-size (MDN 链接)
The tab-size CSS property is used to customize the width of a tab (U+0009) character.
In CSS, tabs are preserved in an element as shown above if the attribute white-space set to pre. CSS 3 defines tab-size property, which adjusts the number of spaces for the tab character from the default of 8. The latest version of WebKit supports the tab-size property. The Opera web browser supports the -o-tab-size CSS property, the Firefox web browser supports the -moz-tab-size CSS property with the same meaning.
注:Support 较差(尽管 MS Edge 正在考虑该属性,但 IE 的支持为零)。
关于jquery - 如何更改文本中制表符的大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34090866/