What is the CSS border-top property?
The border-top property in CSS is used to define the properties of the top in one line. This property is used to define the color, style, and width of the top border.
It is a shorthand property of the following:
border-top-widthborder-top-styleborder-top-color
The
border-top-styleis compulsory to define.
Syntax
border-top: border-width border-style border-color|initial|inherit;
Property values
-
border-top-width: This is used to specify the width of the border. Medium is the default value. -
border-top-style: This has a default value ofNULL. It is used to set the style of the border. -
border-top-color: This is used to set the color of the border. -
initial: This is used to set the value to its default value. -
inherit: This is used to inherit property from its parent value.
Code
In the code above, the border-top property of class .bdr has been set to 25px width, solid style, and skyblue color.