Docs LogoDocs

Borders - Border Styling

Documentation for Borders - Border Styling.

Borders - Border Styling

What are Border Properties?

Border properties control the appearance of borders around elements, including width, style, color, and radius.

Border Properties - Quick Reference

PropertyDescriptionExample
border-widthBorder thicknessborder-width: 2px;
border-styleBorder styleborder-style: solid;
border-colorBorder colorborder-color: #007bff;
borderShorthandborder: 2px solid #007bff;
border-radiusRounded cornersborder-radius: 8px;
border-topTop borderborder-top: 1px solid black;
border-rightRight borderborder-right: 1px solid black;
border-bottomBottom borderborder-bottom: 1px solid black;
border-leftLeft borderborder-left: 1px solid black;

Border Styles

.solid { border-style: solid; }
.dashed { border-style: dashed; }
.dotted { border-style: dotted; }
.double { border-style: double; }
.groove { border-style: groove; }
.ridge { border-style: ridge; }
.inset { border-style: inset; }
.outset { border-style: outset; }
.none { border-style: none; }

Detailed Examples

1. Basic Border

.box {
    border: 2px solid #007bff;
}

2. Individual Sides

.card {
    border-top: 3px solid #007bff;
    border-right: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    border-left: 1px solid #ddd;
}

3. border-radius

.rounded {
    border-radius: 8px;
}

.circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
}

.pill {
    border-radius: 50px;
}

.custom {
    border-radius: 10px 20px 30px 40px; /* top-left, top-right, bottom-right, bottom-left */
}

Common Patterns

Pattern 1: Card with Border

.card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
}

.card:hover {
    border-color: #007bff;
}

Pattern 2: Accent Border

.accent-box {
    border-left: 4px solid #007bff;
    padding-left: 15px;
}

Pattern 3: Button

.btn {
    border: 2px solid #007bff;
    border-radius: 4px;
    padding: 10px 20px;
}

Last updated on July 15, 2026

On this page