Borders

Learn how to add borders to HTML elements using Bootstrap.

Borders are an essential part of CSS and help distinguish HTML elements from one another. Some HTML elements include borders by default—for example, <button>, <input>, etc.

We add borders to an element using the .border class with the help of Bootstrap. The .border class defaults to these settings: 1px solid #dee2e6!important;. Let’s take a closer look at those elements:

  • 1px: A border width of 1px.
  • solid: A border style of solid.
  • #dee2e6: A border color of very light gray.
  • !important: Overrides all other style properties applied to this element.

Get hands-on with 1200+ tech skills courses.