Last updated: 13 May 2024

Tailwind CSS Border Style

The tailwind border style utility .


Tailwind Border Style

In Tailwind CSS, the border-style property is used to define the style of the border around an element. There are several styles available, including solid, dashed, dotted, double, and none.

Applying Tailwind Border Style

In Tailwind CSS, you can apply a border style to an element using the border-{style} utility, where {style} is the border style. For example, to apply a solid border, you would use the border-solid class as shown below:

html
<div class="border border-solid">This div has a solid border.</div>

Preview

This div has a solid border

For example, to give a div a dashed border:

html
<div class="border border-dashed">This div has a dashed border.</div>

Preview

This div has a dashed border

For example, to give a div a dotted border:

html
<div class="border border-dotted">This div has a dotted border.</div>

Preview

This div has a dotted border

For example, to give a div a double border:

html
<div class="border border-double">This div has a double border.</div>

Preview

This div has a double border

For example, to give a div a none border:

html
<div class="border border-none">This div has a none border.</div>

Preview

This div has a none border

Customizing Tailwind Border Styles

Tailwind CSS allows you to customize border styles using the tailwind.config.js file. You can extend the default configuration and define your own custom border styles.

Here's an example of how to add a new border style:

jsx
// tailwind.config.js
module.exports = {
variants: {
extend: {
// ...
borderStyle: ["hover", "focus"],
},
},
};
html
<div class="border border-hover">This div has a hover border.</div>

Tailwind CSS Border Style

ClassProperties
border-solidborder-style: solid;
border-dashedborder-style: dashed;
border-dottedborder-style: dotted;
border-doubleborder-style: double;
border-noneborder-style: none;

Windframe is a drag and drop builder for rapidly building tailwind css websites and UIs

Start building stunning tailwind UIs! 

Build from scratch or select prebuilt tailwind templates