border width

Education is not limited to just classrooms. It can be gained anytime, anywhere... - Ravi Ranjan (M.Tech-NIT)

CSS border-width Property


Set the width of the four borders:

    border-style: solid;
    border-width: 15px;


Definition and Usage

The border-width property sets the width of an element's four borders. This property can have from one to four values.


  • border-width:thin medium thick 10px;
    • top border is thin
    • right border is medium
    • bottom border is thick
    • left border is 10px
  • border-width:thin medium thick;
    • top border is thin
    • right and left borders are medium
    • bottom border is thick
  • border-width:thin medium;
    • top and bottom borders are thin
    • right and left borders are medium
  • border-width:thin;
    • all four borders are thin

Note: Always declare the border-style property before the border-width property. An element must have borders before you can set the width.



CSS Syntax

border-width: medium|thin|thick|length|initial|inherit;

Property Values

Value Description  
medium Specifies a medium border. This is default  
thin Specifies a thin border  
thick Specifies a thick border  
length Allows you to define the thickness of the border