About 2966 letters

About 15 minutes

#CSS Borders

In CSS, borders are defined using the border property. For example:

border: 1px solid red; /* Border width: 1px, style: solid, color: red */ border-width: 2px; /* Border width: 2px */ border-style: dotted; /* Border style: dotted */ border-color: yellow; /* Border color: yellow */ border-radius: 5px; /* Rounded corners with 5px radius */ /* "left" can be replaced with right, top, or bottom for other sides */ border-left: 1px solid red; /* Left border: 1px solid red */ border-left-width: 1px; /* Left border width: 1px */ border-left-style: dotted; /* Left border style: dotted */ border-left-color: yellow; /* Left border color: yellow */ border-top-left-radius: 5px; /* Top-left corner radius: 5px */

Example:

CSS Borders

border: 1px solid cyan;
border: 1px solid cyan;
border-top-left-radius: 10px;

Common border styles include:

Border StyleDescription
dottedDotted line
dashedDashed line
solidSolid line
doubleDouble lines
grooveBorder appears sunken
ridgeBorder appears sunken
insetContent appears sunken
outsetContent appears raised

CSS Border Styles

border: 1px dotted cyan;
border: 1px dashed cyan;
border: 1px solid cyan;
border: 4px double cyan;
border: 8px groove cyan;
border: 8px ridge cyan;
border: 8px inset cyan;
border: 8px outset cyan;

Created in 5/20/2025

Updated in 5/20/2025