边框
用于控制元素轮廓偏移的工具类.
| Class | Styles |
|---|---|
outline-offset-<number> | outline-offset: <number>px; |
-outline-offset-<number> | outline-offset: calc(<number>px * -1); |
outline-offset-(<custom-property>) | outline-offset: var(<custom-property>); |
outline-offset-[<value>] | outline-offset: <value>; |
使用类似 轮廓偏移-2 和 轮廓偏移-4 的工具类来改变元素的轮廓偏移:
轮廓偏移-0
轮廓偏移-2
轮廓偏移-4
<button class="outline-2 outline-offset-0 ...">按钮 A</button><button class="outline-2 outline-offset-2 ...">按钮 B</button><button class="outline-2 outline-offset-4 ...">按钮 C</button>Use the outline-offset-[<value>] syntax to set the 轮廓偏移 based on a completely custom value:
<div class="outline-offset-[2vw] ..."> <!-- ... --></div>For CSS variables, you can also use the outline-offset-(<custom-property>) syntax:
<div class="outline-offset-(--my-outline-offset) ..."> <!-- ... --></div>This is just a shorthand for outline-offset-[var(<custom-property>)] that adds the var() function for you automatically.
Prefix an outline-offset utility with a breakpoint variant like md: to only apply the utility at medium screen sizes and above:
<div class="outline md:outline-offset-2 ..."> <!-- ... --></div>Learn more about using variants in the variants documentation.