跳到主要内容
输入关键词开始搜索,↑ ↓ 选择,Enter 打开
没有找到匹配的文档

行高

用于控制行高的工具,包括紧密、正常和宽松的间距。

类名样式
.lh-1line-height: 1;
.lh-smline-height: var(--bs-line-height-sm);
.lh-mdline-height: var(--bs-line-height-md);
.lh-lgline-height: var(--bs-line-height-lg);

行高

使用.lh-*工具更改行高。

这是一个很长的段落,用于展示我们的工具类如何影响元素的行高。类可以应用于元素本身,有时也应用于父元素。这些类可以根据需要通过我们的工具类 API 进行自定义。

这是一个很长的段落,用于展示我们的工具类如何影响元素的行高。类可以应用于元素本身,有时也应用于父元素。这些类可以根据需要通过我们的工具类 API 进行自定义。

这是一个很长的段落,用于展示我们的工具类如何影响元素的行高。类可以应用于元素本身,有时也应用于父元素。这些类可以根据需要通过我们的工具类 API 进行自定义。

这是一个很长的段落,用于展示我们的工具类如何影响元素的行高。类可以应用于元素本身,有时也应用于父元素。这些类可以根据需要通过我们的工具类 API 进行自定义。

HTML
<p class="lh-1">This is a long paragraph written to show how the line-height of an element is affected by our utilities. Classes are applied to the element itself or sometimes the parent element. These classes can be customized as needed with our utility API.</p>
<p class="lh-sm">This is a long paragraph written to show how the line-height of an element is affected by our utilities. Classes are applied to the element itself or sometimes the parent element. These classes can be customized as needed with our utility API.</p>
<p class="lh-md">This is a long paragraph written to show how the line-height of an element is affected by our utilities. Classes are applied to the element itself or sometimes the parent element. These classes can be customized as needed with our utility API.</p>
<p class="lh-lg">This is a long paragraph written to show how the line-height of an element is affected by our utilities. Classes are applied to the element itself or sometimes the parent element. These classes can be customized as needed with our utility API.</p>

CSS

Sass 工具 API

行高工具在我们的工具 API 中的 scss/_utilities.scss 中声明。了解如何使用工具 API。

"line-height": (
  property: line-height,
  class: lh,
  values: (
    1: 1,
    sm: var(--line-height-sm),
    md: var(--line-height-md),
    lg: var(--line-height-lg),
  )
),