Border Properties
The CSS border properties allow you to specify the style, width, and color of an element's border.
- border-style
- border-width
- border-color
- border
border-style
The Border style property is used to specify the border type which you want to display on the web page. We can set this property to none, hidden, dotted, dashed, solid, double, groove, ridge, inset, outset.
Example:
p{
border-style : dashed;
}
border-width
The border-width property is used to set the border's width. It is set in pixels. We can set this property to thin, medium or thick to set the width of the border.
Example:
p{
border-style : solid;
border-width : 3px;
}
border-color
It sets of border. We can set this property to transparent and color value.
Example:
p{
border-style : solid;
border-color : red;
}
border
It is shorthand of all border properties. The order should be: border-width, border-style, and border-color.
Example:
p{
border : 3px solid blue;
}