Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

CSS border property


May 05, 2021 CSS Reference Manual


Table of contents


CSS border property


Set four border styles:

p
{
border:5px solid red;
}

Try it out . . .

Label definition and instructions for use

The abbreviated border properties are set in one declaration for all border properties.

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

If one of the above values is missing it does not matter, e.g. #FF0000; is allowed.

Default: not specified
Inherited: no
Version: CSS1
JavaScript syntax: object object.style.border="3px solid blue"


Browser support

The numbers in the table support the first browser version number of the property.

Attributes
border 1.0 4.0 1.0 1.0 3.5

The property value

Value Description
border-width Specifies the width of the border
border-style Specify the style of the border
border-color Specify the color of the border
inherit Specifies that the border property value should be inherited from the parent element


Related articles

CSS tutorial: CSS Border