CSS border-top property

CSS border-top

CSS border-top property is a short hand property. It is used to set the properties for top border.

border-top consists of following shorthand properties

  • border-top-width : It is used to specify the top borders width.
  • border-top-style : It is used to specify the top borders style.
  • border-top-color : It is used to specify the top borders colors.

Example

Try Yourself

In the above example values used in border-top property are,

2px - border-top-width

dashed, ridge, dotted - border-top-style

violet, blue, green - border-top-color