Most of us are aware of just a few CSS Border style options - solid, dotted or dashed. But do you know there are more, and some of them are pretty awesome!

Let's take a look at 10 such must-know CSS border styles with examples.
Example 1: Dotted
<style>
.border-dotted {
background-color: lightgrey;
width: 200px;
height: 100px;
padding: 20px;
border: 1px;
border-width: 5px;
border-style: dotted;
border-color: red;
border-radius: 10px;
}
</style>
<div class="border-dotted">CSS Border Style Dotted</div>
CSS Border Style Dotted
Example 2: Dashed
<style>
.border-dashed {
background-color: lightgrey;
width: 200px;
height: 100px;
padding: 20px;
border: 1px;
border-width: 5px;
border-style: dashed;
border-color: red;
border-radius: 10px;
}
</style>
<div class="border-dashed">CSS Border Style Dashed</div>
CSS Border Style Dashed
Example 3: Solid
<style>
.border-solid {
background-color: lightgrey;
width: 200px;
height: 100px;
padding: 20px;
border: 1px;
border-width: 5px;
border-style: solid;
border-color: red;
border-radius: 10px;
}
</style>
<div class="border-dashed">CSS Border Style Solid</div>
CSS Border Style Solid
Example 4: Double
<style>
.border-double {
background-color: lightgrey;
width: 200px;
height: 100px;
padding: 20px;
border: 1px;
border-width: 5px;
border-style: solid;
border-color: red;
border-radius: 10px;
}
</style>
<div class="border-double">CSS Border Style Double</div>
CSS Border Style Double
Example 5: Groove
<style>
.border-groove {
background-color: lightgrey;
width: 200px;
height: 100px;
padding: 20px;
border: 1px;
border-width: 5px;
border-style: groove;
border-color: red;
border-radius: 10px;
}
</style>
<div class="border-groove">CSS Border Style Groove</div>
CSS Border Style Groove
Example 6: Ridge
<style>
.border-ridge {
background-color: lightgrey;
width: 200px;
height: 100px;
padding: 20px;
border: 1px;
border-width: 5px;
border-style: ridge;
border-color: red;
border-radius: 10px;
}
</style>
<div class="border-ridge">CSS Border Style Ridge</div>
CSS Border Style Ridge
Example 7: Inset
<style>
.border-inset {
background-color: lightgrey;
width: 200px;
height: 100px;
padding: 20px;
border: 1px;
border-width: 5px;
border-style: inset;
border-color: red;
border-radius: 10px;
}
</style>
<div class="border-inset">CSS Border Style Inset</div>
CSS Border Style Inset
Example 8: Outset
<style>
.border-outset {
background-color: lightgrey;
width: 200px;
height: 100px;
padding: 20px;
border: 1px;
border-width: 5px;
border-style: outset;
border-color: red;
border-radius: 10px;
}
</style>
<div class="border-outset">CSS Border Style Outset</div>
CSS Border Style Outset
Example 9: Hidden
<style>
.border-hidden {
background-color: lightgrey;
width: 200px;
height: 100px;
padding: 20px;
border: 1px;
border-width: 5px;
border-style: ridge;
border-color: red;
border-radius: 10px;
}
</style>
<div class="border-hidden">CSS Border Style Hidden</div>
CSS Border Style Hidden
Example 10: None
<style>
.border-none {
background-color: lightgrey;
width: 200px;
height: 100px;
padding: 20px;
border: 1px;
border-width: 5px;
border-style: none;
border-color: red;
border-radius: 10px;
}
</style>
<div class="border-none">CSS Border Style None</div>
CSS Border Style None
-
Facing issues? Have Questions? Post them here! I am happy to answer!
More Posts related to CSS,
- Elegant CSS Box Shadows Ideas
- How to Vertically Center Align Text in a Div using CSS Code Example
- How to Center Align Image in Bootstrap
- Change CSS Background Opacity with Examples
- Tutorial : Simple Lightweight Pure CSS based Vertical Navigation Menu
- Simple CSS Grid Example
- CSS: Apply opacity only for div background and not text
- How to create a circular Image using pure CSS Code
- How to place two div elements next to each other
- Responsive Web Design with CSS Media Queries: A Beginner's Tutorial [Updated for 2023]
- Add scroll to div element in HTML Css
- How to make div or text in html unselectable using CSS
- reCAPTCHA Implementation Tutorial
- Set Falling Show on Website for Christmas using Pure CSS Code
- How to set CSS background-Image Property
- List of 32 CSS cursors web developers must know about
- 10 Must Know CSS Border Styles with Examples
- How to make jsfiddle bootstrap ready
- Horizontally Center Align
- Tailwind CSS Hello World Example
- align image at middle of div element
- Only Chessboard using HTML and CSS Code Example
More Posts:
- How to Clear Cache for a website (URL) in Safari for Mac - MacOS
- How to remove old 404 pages ulrs from Google crawler - Html
- 5 Programming Languages to Learn in the Year 2021 - News
- Python: Pandas Rename Specific Column names in DataFrame Example - Python
- How to know the version of Ubuntu - Ubuntu
- Strikethrough Text in Excel for Mac - MacOS
- Fix: chroot: failed to run command /bin/bash: No such file or directory - Bash
- [docker] Error response from daemon: No such container - Docker