🔥Limited Offer: Get 50% OFFon AI & Full Stack Courses🔥
Back to CSS Notes
Topic #22

Border Width


CSS Border Width

The border-width property specifies the width of the four borders.

The width can be set as a specific size (in px, pt, cm, em, etc) or by using one of the three pre-defined values: thin, medium, or thick:

Example

p.one
{

border-style: solid;

border-width: 5px;

}

p.two
{

border-style: solid;

  border-width: medium;

}

p.three
{

border-style: dotted;

  border-width: 2px;

}

p.four
{

border-style: dotted;

    border-width: thick;

}

Specific Side Widths

The border-width property can have from one to four values (for the top border, right border, bottom border, and the left border):

Example

  p.one {
  border-style: solid;
  border-width: 5px 20px; /*
  5px top and bottom, 20px on the sides */
}

p.two {
  border-style:
  solid;
  border-width: 20px 5px; /* 20px top and bottom, 5px on the
  sides */
}

p.three {
  border-style: solid;
  border-width: 25px 10px
  4px 35px; /* 25px top, 10px right, 4px bottom and 35px left */
}

Want to go beyond the notes?

Join CodingNow 2.0's CSS course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available

Border Width – FAQs

Quick answers about learning Border Width in CSS.

This free note from CodingNow 2.0 explains Border Width in CSS — concept, syntax and worked code examples you can copy, run and revise before interviews.
Yes. Every CSS topic on CodingNow 2.0, including Border Width, is 100% free with no signup required.
With focused practice, most students grasp Border Width in 1–3 days from these notes; pairing it with CodingNow 2.0's mentor-led course takes you to job-ready depth faster.
Use the code examples in this note, then ask doubts for free on the CodingNow 2.0 Community (/community) — expert instructors answer within 24 hours.
WhatsApp
Call NowEnroll Now