Border div bootstrap
In this article, we will see about how to set border for div using bootstrap classes.
Step by step guide to set border for div
- Create HTML file and link the “bootstrap” file using <link> tag.
- Create a <div> tag and set the classname “border border-primary d-inline p-1”.
- border – creating border
- border-primary – set border color
- d-inline – set display property to inline, because div is block level element. If you don’t set this, the
- div border will display at full width
- p-1 – set padding.
Code:
<div class="d-inline border border-primary">
TEXT
</div>
Output:
If you want to add dotted border, we need to add the classname “border-dotted“