Red border, width 2px
### **Border Style**
Tailwind CSS also supports setting border styles, such as solid, dashed, dotted, etc. Through the `border-{style}` utility class, you can control the display style of borders.
| Class | Description | Example |
| --- | --- | --- |
| `border-solid` | Sets solid border (default) | `border-solid` |
| `border-dashed` | Sets dashed border | `border-dashed` |
| `border-dotted` | Sets dotted border | `border-dotted` |
| `border-double` | Sets double border | `border-double` |
Blue dashed border, width 4px
### **Border Radius**
By setting `border-radius`, you can control the rounded corner effect of elements. Tailwind CSS provides various border radius values and allows you to set different rounded corners in different directions.
| Class | Description | Example |
| --- | --- | --- |
| `rounded-{size}` | Sets uniform corner radius | `rounded-lg` (large corner) |
| `rounded-tl-{size}` | Sets top-left corner | `rounded-tl-sm` (small corner) |
| `rounded-tr-{size}` | Sets top-right corner | `rounded-tr-md` (medium corner) |
| `rounded-br-{size}` | Sets bottom-right corner | `rounded-br-lg` (large corner) |
| `rounded-bl-{size}` | Sets bottom-left corner | `rounded-bl-xl` (extra large corner) |
Large rounded border
### **Border Control in Four Directions**
You can individually control the border in each direction (top, right, bottom, left), e.g., `border-t-2` controls the top border width, `border-r-4` controls the right border width, etc.
| Class | Description | Example |
| --- | --- | --- |
| `border-t-{size}` | Sets top border width | `border-t-2` (top border width 2px) |
| `border-r-{size}` | Sets right border width | `border-r-4` (right border width 4px) |
| `border-b-{size}` | Sets bottom border width | `border-b-1` (bottom border width 1px) |
| `border-l-{size}` | Sets left border width | `border-l-3` (left border width 3px) |
Custom borders in each direction
### **Unified Border Control**
If you want to set the same style for all borders, you can use the `border` utility class. You can combine it with other utility classes to control color, style, and width.
| Class | Description | Example |
| --- | --- | --- |
| `border` | Sets all border widths to 1px, solid | `border` (default width 1px) |
| `border-2` | Sets all border widths to 2px | `border-2` (2px solid) |
YouTip