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:
<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:
<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:
<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:
<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:
<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:
// tailwind.config.jsmodule.exports = { variants: { extend: { // ... borderStyle: ["hover", "focus"], }, },};
<div class="border border-hover">This div has a hover border.</div>
Tailwind CSS Border Style
Class | Properties |
---|---|
border-solid | border-style: solid; |
border-dashed | border-style: dashed; |
border-dotted | border-style: dotted; |
border-double | border-style: double; |
border-none | border-style: none; |
Windframe is a drag and drop builder for rapidly building tailwind css websites and UIs