Skill ID: StylingCommonParts_22
Description: Create visual horizontal or vertical lines to break up sections.
Where to apply: Between articles on a homepage, in long forms.
Key Tailwind Classes:
border-t
,
border-l
Gotcha:
Using a `<div>` with a tiny height (e.g.,
h-px
) and a background color (e.g.,
bg-gray-300
) is often more flexible for horizontal dividers than just
border-t
on an existing element, especially for controlling spacing around the line.
Horizontal Divider using
border-t
:
Horizontal Divider using
h-px
and
bg-gray-300
(as mentioned in Gotcha):
Vertical Divider using
border-l
(within a flex container):
Note: The actual color, thickness, and style of borders can be controlled with other Tailwind utilities like
border-gray-300
,
border-2
,
border-dashed
etc. The classes
border-t
and
border-l
just specify which side the border appears on (top and left, respectively).