Web Tools Table Maker3schools TranslateImage CompressorFavicon Icon GeneratorCrop & Resize Image
Apu
Apu October 11, 2022 › #border #css

CSS border-width property

The border-width property in css allows us to set the border width of an element (div,span etc.).

Example : set 15px width to the border
div{border-width:15px}
Try it Yourself »

Css border-width property can have from one to four values.

Syntax - four values.

div{border-width:5px 10px 15px 20px} Try it Yourself »
  1. Top border is 5px.
  2. Right border is 10px.
  3. Bottom border is 15px.
  4. Left border is 20px.

Css Syntax

border-width:medium | thin | thick | 15px | 1em;

In CSS, there are four seperate properties to style an element's border. They are :

.new-div{
    border-top-width: 10px;
    border-bottom-width: 5px;
    border-left-width: 25px;
    border-right-width: 45px;
  }
Try it Yourself »
save
listen
AI Answer
Write Your Answer
loading
back
View All