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

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

Updated: 5/20/2025

Author: PlanC

Created: 5/20/2025