
In this Tutorial, we will see ways in which we can add borders to div elements in HTML Style attributes border and border-style,
Example 1: Solid Border
Code:
<div style="border:1px solid">Some text</div>
Example 2: Solid Border with color
Code:
<div style="border:1px solid #00ff22">Some text</div>
Example 3: Dotted Border with color
Code:
<div style="border:1px dotted red">Some text</div>
Example 4: Dashed Border with color
Code:
<div style="border:1px dashed red">Some text</div>
Example 5: Double Border
Code:
<div style="border-style:double">Some text</div>
Example 6: Groove Border
Code:
<div style="border-style: groove">Some text</div>
Example 7: Ridge Border
Code:
<div style="border-style: ridge">Some text</div>
Example 8: Inset Border
Code:
<div style="border-style: inset">Some text</div>
Example 9: Outset Border
Code:
<div style="border-style: outset">Some text</div>
Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!