VOOZH about

URL: https://www.geeksforgeeks.org/bootstrap/bootstrap-5-border-width/

⇱ Bootstrap 5 Border-width - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Bootstrap 5 Border-width

Last Updated : 16 Jan, 2023

Bootstrap 5 Border width is used to display an outline around a box and it provides style, color, and radius of an element border on the side. The border width sets the width of an element's four borders. The width can be set as a specific size by using defined values.

Bootstrap5 Border width classes used:

  • border-*: This class is used to set the width of the border to 1-5 px. (Replace * with any size from 1 to 5)

Syntax:

<div class="border border-*">
 ...
</div>

Note: Here * can be replaced by a size from 1-5. 

Example 1: In this example, we set the border width of the elements in four directions by using border-1,border-2,border-3 classes

Output:

👁 Image
 

Example 2: In this example, we set the border width of the elements in four directions by using border-1, border-4, and border-5 classes.

Output:

👁 Image
 

Reference: https://getbootstrap.com/docs/5.0/utilities/borders/#border-width

Comment

Explore