Golang Tutorials - Learn Go Programming with Easy Step-by-Step Guides

Explore comprehensive Golang tutorials for beginners and advanced programmers. Learn Go programming with easy-to-follow, step-by-step guides, examples, and practical tips to master Go language quickly.

Border Width Color Radius in TailwindCSS

Border Width Color Radius in TailwindCSS

? Border Width, Color, and Radius in Tailwind CSS

Tailwind provides easy utilities to style borders including width, color, and radius for rounded corners.


1. Border Width (border, border-{side}-{width})

Set the width of borders on all or specific sides.

ClassCSS EquivalentDescription
borderborder-width: 1px;Border all sides 1px
border-0border-width: 0;No border
border-2border-width: 2px;2px border
border-4border-width: 4px;4px border
border-8border-width: 8px;8px border

Border side specific:

ClassCSS EquivalentDescription
border-tborder-top-width: 1px;Top border
border-b-4border-bottom-width: 4px;Bottom border 4px
border-l-2border-left-width: 2px;Left border 2px
border-rborder-right-width: 1px;Right border

2. Border Color (border-{color})

Set border colors from Tailwind’s color palette.

ClassCSS EquivalentDescription
border-blackborder-color: #000;Black border
border-whiteborder-color: #fff;White border
border-gray-500border-color: #6b7280;Gray shade border
border-red-600border-color: #dc2626;Red border
border-blue-400border-color: #60a5fa;Blue border
......Many colors available

Use arbitrary colors too:

<div class="border" style="border-color: #ff5733;">  Custom color border</div>

3. Border Radius (rounded-*)

Control the roundness of corners.

ClassCSS EquivalentDescription
rounded-noneborder-radius: 0;No rounded corners
rounded-smborder-radius: 0.125rem;Small rounding
roundedborder-radius: 0.25rem;Default rounding
rounded-mdborder-radius: 0.375rem;Medium rounding
rounded-lgborder-radius: 0.5rem;Large rounding
rounded-xlborder-radius: 0.75rem;Extra large rounding
rounded-2xlborder-radius: 1rem;2x Extra large rounding
rounded-3xlborder-radius: 1.5rem;3x Extra large rounding
rounded-fullborder-radius: 9999px;Fully rounded (circle)

Rounded corners on specific sides:

ClassCSS EquivalentDescription
rounded-tRound top-left & top-rightRound only top corners
rounded-b-lgLarge rounding bottom cornersRound only bottom
rounded-l-mdMedium rounding left cornersRound left only
rounded-r-fullFully rounded right cornersRound right only
rounded-tlRound top-left corner only
rounded-brRound bottom-right corner only

Example:

<div class="border-4 border-blue-500 rounded-lg p-4">  This div has a 4px blue border with medium rounded corners.</div>

If you want examples with hover border colors or responsive border radius, just ask!

Disclaimer for AI-Generated Content:
The content provided in these tutorials is generated using artificial intelligence and is intended for educational purposes only.
html
docker
php
kubernetes
golang
mysql
postgresql
mariaDB
sql