边框
用于控制元素边框半径的实用工具。
类 | 样式 | ||
---|---|---|---|
rounded-xs | border-radius: var(--radius-xs); /* 0.125rem (2px) */ | ||
rounded-sm | border-radius: var(--radius-sm); /* 0.25rem (4px) */ | ||
rounded-md | border-radius: var(--radius-md); /* 0.375rem (6px) */ | ||
rounded-lg | border-radius: var(--radius-lg); /* 0.75rem (8px) */ | ||
rounded-xl | border-radius: var(--radius-xl); /* 0.75rem (12px) */ | ||
rounded-2xl | border-radius: var(--radius-2xl); /* 1rem (16px) */ | ||
rounded-3xl | border-radius: var(--radius-3xl); /* 1.5rem (24px) */ | ||
rounded-none | border-radius: 0; | ||
rounded-full | border-radius: calc(infinity * 1px); | ||
rounded-(<custom-property>) | border-radius: var(<custom-property>); | ||
rounded-[<value>] | border-radius: <value>; | ||
rounded-s-xs | border-start-start-radius: var(--radius-xs); /* 0.125rem (2px) */ border-end-start-radius: var(--radius-xs); /* 0.125rem (2px) */ | ||
rounded-s-sm | border-start-start-radius: var(--radius-sm); /* 0.25rem (4px) */ border-end-start-radius: var(--radius-sm); /* 0.25rem (4px) */ | ||
rounded-s-md | border-start-start-radius: var(--radius-md); /* 0.375rem (6px) */ border-end-start-radius: var(--radius-md); /* 0.375rem (6px) */ | ||
rounded-s-lg | border-start-start-radius: var(--radius-lg); /* 0.75rem (8px) */ border-end-start-radius: var(--radius-lg); /* 0.75rem (8px) */ | ||
rounded-s-xl | border-start-start-radius: var(--radius-xl); /* 0.75rem (12px) */ border-end-start-radius: var(--radius-xl); /* 0.75rem (12px) */ | ||
rounded-s-2xl | border-start-start-radius: var(--radius-2xl); /* 1rem (16px) */ border-end-start-radius: var(--radius-2xl); /* 1rem (16px) */ | ||
rounded-s-3xl | border-start-start-radius: var(--radius-3xl); /* 1.5rem (24px) */ border-end-start-radius: var(--radius-3xl); /* 1.5rem (24px) */ | ||
rounded-s-none | border-start-start-radius: 0; border-end-start-radius: 0; | ||
rounded-s-full | border-start-start-radius: calc(infinity * 1px); border-end-start-radius: calc(infinity * 1px); | ||
rounded-s-(<custom-property>) | border-start-start-radius: var(<custom-property>); border-end-start-radius: var(<custom-property>); | ||
rounded-s-[<value>] | border-start-start-radius: <value>; border-end-start-radius: <value>; | ||
rounded-e-xs | border-start-end-radius: var(--radius-xs); /* 0.125rem (2px) */ border-end-end-radius: var(--radius-xs); /* 0.125rem (2px) */ | ||
rounded-e-sm | border-start-end-radius: var(--radius-sm); /* 0.25rem (4px) */ border-end-end-radius: var(--radius-sm); /* 0.25rem (4px) */ | ||
rounded-e-md | border-start-end-radius: var(--radius-md); /* 0.375rem (6px) */ border-end-end-radius: var(--radius-md); /* 0.375rem (6px) */ | ||
rounded-e-lg | border-start-end-radius: var(--radius-lg); /* 0.75rem (8px) */ border-end-end-radius: var(--radius-lg); /* 0.75rem (8px) */ | ||
rounded-e-xl | border-start-end-radius: var(--radius-xl); /* 0.75rem (12px) */ border-end-end-radius: var(--radius-xl); /* 0.75rem (12px) */ | ||
rounded-e-2xl | border-start-end-radius: var(--radius-2xl); /* 1rem (16px) */ border-end-end-radius: var(--radius-2xl); /* 1rem (16px) */ | ||
rounded-e-3xl | border-start-end-radius: var(--radius-3xl); /* 1.5rem (24px) */ border-end-end-radius: var(--radius-3xl); /* 1.5rem (24px) */ | ||
rounded-e-none | border-start-end-radius: 0; border-end-end-radius: 0; | ||
rounded-e-full | border-start-end-radius: calc(infinity * 1px); border-end-end-radius: calc(infinity * 1px); | ||
rounded-e-(<custom-property>) | border-start-end-radius: var(<custom-property>); border-end-end-radius: var(<custom-property>); | ||
rounded-e-[<value>] | border-start-end-radius: <value>; border-end-end-radius: <value>; | ||
rounded-t-xs | border-top-left-radius: var(--radius-xs); /* 0.125rem (2px) */ border-top-right-radius: var(--radius-xs); /* 0.125rem (2px) */ | ||
rounded-t-sm | border-top-left-radius: var(--radius-sm); /* 0.25rem (4px) */ border-top-right-radius: var(--radius-sm); /* 0.25rem (4px) */ | ||
rounded-t-md | border-top-left-radius: var(--radius-md); /* 0.375rem (6px) */ border-top-right-radius: var(--radius-md); /* 0.375rem (6px) */ | ||
rounded-t-lg | border-top-left-radius: var(--radius-lg); /* 0.75rem (8px) */ border-top-right-radius: var(--radius-lg); /* 0.75rem (8px) */ | ||
rounded-t-xl | border-top-left-radius: var(--radius-xl); /* 0.75rem (12px) */ border-top-right-radius: var(--radius-xl); /* 0.75rem (12px) */ | ||
rounded-t-2xl | border-top-left-radius: var(--radius-2xl); /* 1rem (16px) */ border-top-right-radius: var(--radius-2xl); /* 1rem (16px) */ | ||
rounded-t-3xl | border-top-left-radius: var(--radius-3xl); /* 1.5rem (24px) */ border-top-right-radius: var(--radius-3xl); /* 1.5rem (24px) */ | ||
rounded-t-none | border-top-left-radius: 0; border-top-right-radius: 0; | ||
rounded-t-full | border-top-left-radius: calc(infinity * 1px); border-top-right-radius: calc(infinity * 1px); | ||
rounded-t-(<custom-property>) | border-top-left-radius: var(<custom-property>); border-top-right-radius: var(<custom-property>); | ||
rounded-t-[<value>] | border-top-left-radius: <value>; border-top-right-radius: <value>; | ||
rounded-r-xs | border-top-right-radius: var(--radius-xs); /* 0.125rem (2px) */ border-bottom-right-radius: var(--radius-xs); /* 0.125rem (2px) */ | ||
rounded-r-sm | border-top-right-radius: var(--radius-sm); /* 0.25rem (4px) */ border-bottom-right-radius: var(--radius-sm); /* 0.25rem (4px) */ | ||
rounded-r-md | border-top-right-radius: var(--radius-md); /* 0.375rem (6px) */ border-bottom-right-radius: var(--radius-md); /* 0.375rem (6px) */ | ||
rounded-r-lg | border-top-right-radius: var(--radius-lg); /* 0.75rem (8px) */ border-bottom-right-radius: var(--radius-lg); /* 0.75rem (8px) */ | ||
rounded-r-xl | border-top-right-radius: var(--radius-xl); /* 0.75rem (12px) */ border-bottom-right-radius: var(--radius-xl); /* 0.75rem (12px) */ | ||
rounded-r-2xl | border-top-right-radius: var(--radius-2xl); /* 1rem (16px) */ border-bottom-right-radius: var(--radius-2xl); /* 1rem (16px) */ | ||
rounded-r-3xl | border-top-right-radius: var(--radius-3xl); /* 1.5rem (24px) */ border-bottom-right-radius: var(--radius-3xl); /* 1.5rem (24px) */ | ||
rounded-r-none | border-top-right-radius: 0; border-bottom-right-radius: 0; | ||
rounded-r-full | border-top-right-radius: calc(infinity * 1px); border-bottom-right-radius: calc(infinity * 1px); | ||
rounded-r-(<custom-property>) | border-top-right-radius: var(<custom-property>); border-bottom-right-radius: var(<custom-property>); | ||
rounded-r-[<value>] | border-top-right-radius: <value>; border-bottom-right-radius: <value>; | ||
rounded-b-xs | border-bottom-right-radius: var(--radius-xs); /* 0.125rem (2px) */ border-bottom-left-radius: var(--radius-xs); /* 0.125rem (2px) */ | ||
rounded-b-sm | border-bottom-right-radius: var(--radius-sm); /* 0.25rem (4px) */ border-bottom-left-radius: var(--radius-sm); | ||
rounded-b-lg | border-bottom-right-radius: var(--radius-lg); /* 0.75rem (8px) */ border-bottom-left-radius: var(--radius-lg); /* 0.75rem (8px) */ | ||
rounded-b-xl | border-bottom-right-radius: var(--radius-xl); /* 0.75rem (12px) */ border-bottom-left-radius: var(--radius-xl); /* 0.75rem (12px) */ | ||
rounded-b-2xl | border-bottom-right-radius: var(--radius-2xl); /* 1rem (16px) */ border-bottom-left-radius: var(--radius-2xl); /* 1rem (16px) */ | ||
rounded-b-3xl | border-bottom-right-radius: var(--radius-3xl); /* 1.5rem (24px) */ border-bottom-left-radius: var(--radius-3xl); /* 1.5rem (24px) */ | ||
rounded-b-none | border-bottom-right-radius: 0; border-bottom-left-radius: 0; | ||
rounded-b-full | border-bottom-right-radius: calc(infinity * 1px); border-bottom-left-radius: calc(infinity * 1px); | ||
rounded-b-(<custom-property>) | border-bottom-right-radius: var(<custom-property>); border-bottom-left-radius: var(<custom-property>); | ||
rounded-b-[<value>] | border-bottom-right-radius: <value>; border-bottom-left-radius: <value>; | ||
rounded-l-xs | border-top-left-radius: var(--radius-xs); /* 0.125rem (2px) */ border-bottom-left-radius: var(--radius-xs); /* 0.125rem (2px) */ | ||
rounded-l-sm | border-top-left-radius: var(--radius-sm); /* 0.25rem (4px) */ border-bottom-left-radius: var(--radius-sm); /* 0.25rem (4px) */ | ||
rounded-l-md | border-top-left-radius: var(--radius-md); /* 0.375rem (6px) */ border-bottom-left-radius: var(--radius-md); /* 0.375rem (6px) */ | ||
rounded-l-lg | border-top-left-radius: var(--radius-lg); /* 0.75rem (8px) */ border-bottom-left-radius: var(--radius-lg); /* 0.75rem (8px) */ | ||
rounded-l-xl | border-top-left-radius: var(--radius-xl); /* 0.75rem (12px) */ border-bottom-left-radius: var(--radius-xl); /* 0.75rem (12px) */ | ||
rounded-l-2xl | border-top-left-radius: var(--radius-2xl); /* 1rem (16px) */ border-bottom-left-radius: var(--radius-2xl); /* 1rem (16px) */ | ||
rounded-l-3xl | border-top-left-radius: var(--radius-3xl); /* 1.5rem (24px) */ border-bottom-left-radius: var(--radius-3xl); /* 1.5rem (24px) */ | ||
rounded-l-none | border-top-left-radius: 0; border-bottom-left-radius: 0; | ||
rounded-l-full | border-top-left-radius: calc(infinity * 1px); border-bottom-left-radius: calc(infinity * 1px); | ||
rounded-l-(<自定义属性>) | border-top-left-radius: var(<自定义属性>); border-bottom-left-radius: var(<自定义属性>); | ||
rounded-l-[<值>] | border-top-left-radius: <值>; border-bottom-left-radius: <值>; | ||
rounded-ss-xs | border-start-start-radius: var(--radius-xs); /* 0.125rem (2px) */ | ||
rounded-ss-sm | border-start-start-radius: var(--radius-sm); /* 0.25rem (4px) */ | ||
rounded-ss-md | border-start-start-radius: var(--radius-md); /* 0.375rem (6px) */ | ||
rounded-ss-lg | border-start-start-radius: var(--radius-lg); /* 0.75rem (8px) */ | ||
rounded-ss-xl | border-start-start-radius: var(--radius-xl); /* 0.75rem (12px) */ | ||
rounded-ss-2xl | border-start-start-radius: var(--radius-2xl); /* 1rem (16px) */ | ||
rounded-ss-3xl | border-start-start-radius: var(--radius-3xl); /* 1.5rem (24px) */ | ||
rounded-ss-none | border-start-start-radius: 0; | ||
rounded-ss-full | border-start-start-radius: calc(infinity * 1px); | ||
rounded-ss-(<自定义属性>) | border-start-start-radius: var(<自定义属性>); | ||
rounded-ss-[<值>] | border-start-start-radius: <值>; | ||
rounded-se-xs | border-start-end-radius: var(--radius-xs); /* 0.125rem (2px) */ | ||
rounded-se-sm | border-start-end-radius: var(--radius-sm); /* 0.25rem (4px) */ | ||
rounded-se-md | border-start-end-radius: var(--radius-md); /* 0.375rem (6px) */ | ||
rounded-se-lg | border-start-end-radius: var(--radius-lg); /* 0.75rem (8px) */ | ||
rounded-se-xl | border-start-end-radius: var(--radius-xl); /* 0.75rem (12px) */ | ||
rounded-se-2xl | border-start-end-radius: var(--radius-2xl); /* 1rem (16px) */ | ||
rounded-se-3xl | border-start-end-radius: var(--radius-3xl); /* 1.5rem (24px) */ | ||
rounded-se-none | border-start-end-radius: 0; | ||
rounded-se-full | border-start-end-radius: calc(infinity * 1px); | ||
rounded-se-(<自定义属性>) | border-start-end-radius: var(<自定义属性>); | ||
rounded-se-[<值>] | border-start-end-radius: <值>; | ||
rounded-ee-xs | border-end-end-radius: var(--radius-xs); /* 0.125rem (2px) */ | ||
rounded-ee-sm | border-end-end-radius: var(--radius-sm); /* 0.25rem (4px) */ | ||
rounded-ee-md | border-end-end-radius: var(--radius-md); /* 0.375rem (6px) */ | ||
rounded-ee-lg | border-end-end-radius: var(--radius-lg); /* 0.75rem (8px) */ | ||
rounded-ee-xl | border-end-end-radius: var(--radius-xl); /* 0.75rem (12px) */ | ||
rounded-ee-2xl | border-end-end-radius: var(--radius-2xl); /* 1rem (16px) */ | ||
rounded-ee-3xl | border-end-end-radius: var(--radius-3xl); /* 1.5rem (24px) */ | ||
rounded-ee-none | border-end-end-radius: 0; | ||
rounded-ee-full | border-end-end-radius: calc(infinity * 1px); | ||
rounded-ee-(<自定义属性>) | border-end-end-radius: var(<自定义属性>); | ||
rounded-ee-[<值>] | border-end-end-radius: <值>; | ||
rounded-es-xs | border-end-start-radius: var(--radius-xs); /* 0.125rem (2px) */ | ||
rounded-es-sm | border-end-start-radius: var(--radius-sm); /* 0.25rem (4px) */ | ||
rounded-es-md | border-end-start-radius: var(--radius-md); /* 0.375rem (6px) */ | ||
rounded-es-lg | border-end-start-radius: var(--radius-lg); /* 0.75rem (8px) */ | ||
rounded-es-xl | border-end-start-radius: var(--radius-xl); /* 0.75rem (12px) */ | ||
rounded-es-2xl | border-end-start-radius: var(--radius-2xl); /* 1rem (16px) */ | ||
rounded-es-3xl | border-end-start-radius: var(--radius-3xl); /* 1.5rem (24px) */ | ||
rounded-es-none | border-end-start-radius: 0; | ||
rounded-es-full | border-end-start-radius: calc(infinity * 1px); | ||
rounded-es-(<自定义属性>) | border-end-start-radius: var(<自定义属性>); | ||
rounded-es-[<值>] | border-end-start-radius: <值>; | ||
rounded-tl-xs | border-top-left-radius: var(--radius-xs); /* 0.125rem (2px) */ | ||
rounded-tl-sm | border-top-left-radius: var(--radius-sm); /* 0.25rem (4px) */ | ||
rounded-tl-md | border-top-left-radius: var(--radius-md); /* 0.375rem (6px) */ | ||
rounded-tl-lg | border-top-left-radius: var(--radius-lg); /* 0.75rem (8px) */ | ||
rounded-tl-xl | border-top-left-radius: var(--radius-xl); /* 0.75rem (12px) */ | ||
rounded-tl-2xl | border-top-left-radius: var(--radius-2xl); /* 1rem (16px) */ | ||
rounded-tl-3xl | border-top-left-radius: var(--radius-3xl); /* 1.5rem (24px) */ | ||
rounded-tl-none | border-top-left-radius: 0; | ||
rounded-tl-full | border-top-left-radius: calc(infinity * 1px); | ||
rounded-tl-(<自定义属性>) | border-top-left-radius: var(<自定义属性>); | ||
rounded-tl-[<值>] | border-top-left-radius: <值>; | ||
rounded-tr-xs | border-top-right-radius: var(--radius-xs); /* 0.125rem (2px) */ | ||
rounded-tr-sm | border-top-right-radius: var(--radius-sm); /* 0.25rem (4px) */ | ||
rounded-tr-md | border-top-right-radius: var(--radius-md); /* 0.375rem (6px) */ | ||
rounded-tr-lg | border-top-right-radius: var(--radius-lg); /* 0.75rem (8px) */ | ||
rounded-tr-xl | border-top-right-radius: var(--radius-xl); /* 0.75rem (12px) */ | ||
rounded-tr-2xl | border-top-right-radius: var(--radius-2xl); /* 1rem (16px) */ | ||
rounded-tr-3xl | border-top-right-radius: var(--radius-3xl); /* 1.5rem (24px) */ | ||
rounded-tr-none | border-top-right-radius: 0; | ||
rounded-tr-full | border-top-right-radius: calc(infinity * 1px); | ||
rounded-tr-(<自定义属性>) | border-top-right-radius: var(<自定义属性>); | ||
rounded-tr-[<值>] | border-top-right-radius: <值>; | ||
rounded-br-xs | border-bottom-right-radius: var(--radius-xs); /* 0.125rem (2px) */ | ||
rounded-br-sm | border-bottom-right-radius: var(--radius-sm); /* 0.25rem (4px) */ | ||
rounded-br-md | border-bottom-right-radius: var(--radius-md); /* 0.375rem (6px) */ | ||
rounded-br-lg | border-bottom-right-radius: var(--radius-lg); /* 0.75rem (8px) */ | ||
rounded-br-xl | border-bottom-right-radius: var(--radius-xl); /* 0.75rem (12px) */ | ||
rounded-br-2xl | border-bottom-right-radius: var(--radius-2xl); /* 1rem (16px) */ | ||
rounded-br-3xl | border-bottom-right-radius: var(--radius-3xl); /* 1.5rem (24px) */ | ||
rounded-br-none | border-bottom-right-radius: 0; | ||
rounded-br-full | border-bottom-right-radius: calc(infinity * 1px); | ||
rounded-br-(<自定义属性>) | border-bottom-right-radius: var(<自定义属性>); | ||
rounded-br-[<值>] | border-bottom-right-radius: <值>; | ||
rounded-bl-xs | border-bottom-left-radius: var(--radius-xs); /* 0.125rem (2px) */ | ||
rounded-bl-sm | border-bottom-left-radius: var(--radius-sm); /* 0.25rem (4px) */ | ||
rounded-bl-md | border-bottom-left-radius: var(--radius-md); /* 0.375rem (6px) */ | ||
rounded-bl-lg | border-bottom-left-radius: var(--radius-lg); /* 0.75rem (8px) */ | ||
rounded-bl-xl | border-bottom-left-radius: var(--radius-xl); /* 0.75rem (12px) */ | ||
rounded-bl-2xl | border-bottom-left-radius: var(--radius-2xl); /* 1rem (16px) */ | ||
rounded-bl-3xl | border-bottom-left-radius: var(--radius-3xl); /* 1.5rem (24px) */ | ||
rounded-bl-none | border-bottom-left-radius: 0; | ||
rounded-bl-full | border-bottom-left-radius: calc(infinity * 1px); | ||
rounded-bl-(<自定义属性>) | border-bottom-left-radius: var(<自定义属性>); | ||
rounded-bl-[<值>] | border-bottom-left-radius: <值>; |
使用诸如 rounded-sm
和 rounded-md
等工具类,将不同的边框半径大小应用于元素
rounded-sm
rounded-md
rounded-lg
rounded-xl
<div class="rounded-sm ..."></div><div class="rounded-md ..."></div><div class="rounded-lg ..."></div><div class="rounded-xl ..."></div>
使用诸如 rounded-t-md
和 rounded-r-lg
等工具类,仅圆化元素的某一侧
rounded-t-lg
rounded-r-lg
rounded-b-lg
rounded-l-lg
<div class="rounded-t-lg ..."></div><div class="rounded-r-lg ..."></div><div class="rounded-b-lg ..."></div><div class="rounded-l-lg ..."></div>
使用诸如 rounded-tr-md
和 rounded-tl-lg
等工具类,仅圆化元素的某个角
rounded-tl-lg
rounded-tr-lg
rounded-br-lg
rounded-bl-lg
<div class="rounded-tl-lg ..."></div><div class="rounded-tr-lg ..."></div><div class="rounded-br-lg ..."></div><div class="rounded-bl-lg ..."></div>
使用诸如 rounded-s-md
和 rounded-se-xl
等工具类,使用逻辑属性设置边框半径,这些属性会根据文本方向映射到适当的角
从左到右
从右到左
<div dir="ltr"> <div class="rounded-s-lg ..."></div></div><div dir="rtl"> <div class="rounded-s-lg ..."></div></div>
以下是所有可用的边框半径逻辑属性工具类及其在 LTR 和 RTL 模式下的物理属性等效项。
类 | 从左到右 | 从右到左 |
---|---|---|
rounded-s-* | rounded-l-* | rounded-r-* |
rounded-e-* | rounded-r-* | rounded-l-* |
rounded-ss-* | rounded-tl-* | rounded-tr-* |
rounded-se-* | rounded-tr-* | rounded-tl-* |
rounded-es-* | rounded-bl-* | rounded-br-* |
rounded-ee-* | rounded-br-* | rounded-bl-* |
为了获得更多控制,您还可以使用LTR 和 RTL 修饰符,根据当前的文本方向有条件地应用特定样式。
使用 rounded-full
工具类创建胶囊按钮
rounded-full
<button class="rounded-full ...">Save Changes</button>
使用 rounded-none
工具类移除元素现有的边框半径
rounded-none
<button class="rounded-none ...">Save Changes</button>
使用 rounded-[<值>]
语法 来设置边框半径基于完全自定义的值
<div class="rounded-[2vw] ..."> <!-- ... --></div>
对于 CSS 变量,您还可以使用 rounded-(<自定义属性>)
语法
<div class="rounded-(--my-radius) ..."> <!-- ... --></div>
这只是 rounded-[var(<自定义属性>)]
的简写形式,会自动为您添加 var()
函数。
前缀一个 border-radius
工具类 带有诸如 md:
等断点变体,仅在中等 屏幕尺寸及以上应用该工具类
<div class="rounded md:rounded-lg ..."> <!-- ... --></div>
在变体文档中了解有关使用变体的更多信息。
使用 --radius-*
主题变量自定义项目中的边框半径 工具类
@theme { --radius-5xl: 3rem; }
现在,可以在您的标记中使用 rounded-5xl
工具类
<div class="rounded-5xl"> <!-- ... --></div>
在 主题文档
中了解有关自定义主题的更多信息 .