Borders
Utilities for controlling the style of an element's outline.
Class | Styles |
---|---|
outline-solid | outline-style: solid; |
outline-dashed | outline-style: dashed; |
outline-dotted | outline-style: dotted; |
outline-double | outline-style: double; |
outline-none | outline-style: none; |
outline-hidden | outline: 2px solid transparent;
outline-offset: 2px; |
Use utilities like outline-solid
and outline-dashed
to set the style of an element's outline:
Use the outline-hidden
utility to hide the default browser outline on focused elements, while still preserving the outline in forced colors mode:
Try emulating `forced-colors: active` in your developer tools to see the behavior
It is highly recommended to apply your own focus styling for accessibility when using this utility.
Use the outline-none
utility to completely remove the default browser outline on focused elements:
It is highly recommended to apply your own focus styling for accessibility when using this utility.
Prefix an outline-style
utility with a breakpoint variant like md:
to only apply the utility at medium screen sizes and above:
<div class="outline md:outline-dashed ..."> <!-- ... --></div>
Learn more about using variants in the variants documentation.