CSS- Border

The border properties allow you to specify how the border of the box representing an element should look

The border-color Property

The border-color property allows you to change the color of the border surrounding an element. You can individually change the color of the bottom, left, top and right sides of an element's border using the properties border-bottom-color changes the color of bottom border.

  • border-top-color changes the color of top border.
  • border-left-color changes the color of left border.
  • border-right-color changes the color of right border.
  • Example :-


    This example is showing all borders in different colors.

    This example is showing all borders in green color only.

    The border-style Property

    This example describe how to set the space between characters. Possible values are normal or a number specifying space.

  • none: No border. (Equivalent of border-width:0;)
  • solid: Border is a single solid line.
  • dotted: Border is a series of dots.
  • dashed: Border is a series of short lines.
  • double: Border is two solid lines.
  • groove: Border looks as though it is carved into the page.
  • ridge:Border looks the opposite of groove.
  • inset: Border makes the box look like it is embedded in the page.
  • outset: Border makes the box look like it is coming out of the canvas.
  • hidden: Same as none, except in terms of border-conflict resolution for table elements.
  • Example :-



    This is a border with none width.

    This is a solid border.

    This is a dahsed border.

    This is a double border.

    This is a groove border.

    This is aridge border.

    This is a inset border.

    This is a outset border.

    This is a hidden border.

    This is a a border with four different styles.