View video tutorial

CSS Borders

CSS

It defines the border of an element.

CSS border

➔ Border property used to set the border on an element.

➔ Here are some common border attributes:

  • border-width
  • border-style
  • border-color
  • border-top-style
  • border-right-style
  • border-bottom-style
  • border-left-style

Example

.p1 {
  border-width: 1px;
  border-style: solid;
  border-color: black;
}
Try it Now »

Click on the "Try it Now" button to see how it works.


Example

.p1 {
  border-width: 1px;
  border-style: solid;
  border-color: black;
  border-radius: 5px;
}
Try it Now »

Click on the "Try it Now" button to see how it works.