1. 排版
  2. font-smoothing

排版

font-smoothing

用于控制元素字体平滑度的工具。

样式
antialiased
-webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
subpixel-antialiased
-webkit-font-smoothing: auto; -moz-osx-font-smoothing: auto;

示例(Examples)

¥Examples

灰度抗锯齿(Grayscale antialiasing)

¥Grayscale antialiasing

使用 antialiased 工具使用灰度抗锯齿渲染文本:

¥Use the antialiased utility to render text using grayscale antialiasing:

The quick brown fox jumps over the lazy dog.

<p class="antialiased ...">The quick brown fox ...</p>

子像素抗锯齿(Subpixel antialiasing)

¥Subpixel antialiasing

使用 subpixel-antialiased 工具使用子像素抗锯齿渲染文本:

¥Use the subpixel-antialiased utility to render text using subpixel antialiasing:

The quick brown fox jumps over the lazy dog.

<p class="subpixel-antialiased ...">The quick brown fox ...</p>

响应式设计(Responsive design)

¥Responsive design

前缀 -webkit-font-smoothing and -moz-osx-font-smoothing 工具 使用断点变体如 md: 仅在 medium 屏幕尺寸及以上时应用工具:

<p class="antialiased md:subpixel-antialiased ...">
<!-- ... -->
</p>

请参阅 变体文档 详细了解如何使用变体。

TailwindCSS v4.0 中文网 - 粤ICP备13048890号