CSS Borders

Estimated reading: 1 minute 27 views

Inherited: No

Border

You can set the color, style and width of the borders around an element
in one declaration by using the border property.

 border: 1px solid #333333;

Values:

  • color
  • style
  • width

Or you can set each property individually

Border Color
You can set the color of a border independently with the border-color
property

 border-color: value;

Border Style

You can set the style of a border independently with the border-style
property.

 border-style: value;

Values:

  • dashed
  • dotted
  • double
  • groove
  • hidden
  • inset
  • none
  • outset
  • ridge
  • solid

Border Width

You can set the width of a border independently with the border-width
property.

 border-width: value;

Border Bottom

You can set the color, style and width of the bottom border around an
element in one declaration with the border-bottom property

 border-bottom: 1px solid #333333;

Border Bottom / Border Top … /Border-buttom-color/ Border-top-color

Share this Doc

CSS Borders

Or copy link