The border
property specifies the style, width, and color of an element's border. It is a shorthand property for border-width
, border-style
, and border-color
.
Setting a <h1>
element to a solid red border of 5 pixels width.
h1 { border: 5px solid red; }
border: border-width border-style border-color;
border-style
value is not provided, the default is no border.border-color
value is chosen, the border color will match the color of the text.border-width
value is not provided, the default is medium
.For more information, see https://www.w3schools.com/cssref/pr_border.asp
Found a bug in the documentation? Let us know at documentation@code.org