css border Property

Education is not limited to just classrooms. It can be gained anytime, anywhere... - Ravi Ranjan (M.Tech-NIT)

CSS border Property


Set the style of the four border:

    border: 5px solid red;

Definition and Usage

The border shorthand property sets all the border properties in one declaration.

The properties that can be set, are (in order): border-width, border-style, and border-color.

CSS Syntax

border: border-width border-style border-color|initial|inherit;

Property Values

Value Description
border-width Specifies the width of the border. Default value is "medium"
border-style Specifies the style of the border. Default value is "none"
border-color Specifies the color of the border. Default value is the color of the element
initial Sets this property to its default value. Read about initial
inherit Inherits this property from its parent element. Read about inherit