Border Styles Width and Color
Apply borders with different styles, widths, and colors using shorthand and longhand properties.
border Shorthand
The border shorthand sets all four sides at once: width, style, and color.
.box {
border: 2px solid #333;
}
.warning {
border: 3px dashed red;
}border-style Values
border-style must be set for a border to appear. Available values:
solid— continuous linedashed— long dashesdotted— round dotsdouble— two parallel linesgroove/ridge/inset/outset— 3D effectsnone— no border (default)
All lessons in this course
- Understanding Width Height Margin and Padding
- Border Styles Width and Color
- Box-Sizing: Content-Box vs Border-Box
- Outline and Box-Shadow