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.

Text Alignment Color Decoration in TailwindCSS

Text Alignment Color Decoration in TailwindCSS

?? Text Alignment, Color, and Decoration in Tailwind CSS

Tailwind offers simple classes to style your text alignment, color, and decoration (like underline or strikethrough).


1. Text Alignment (text-*)

Controls horizontal alignment of text.

ClassCSS EquivalentDescription
text-lefttext-align: left;Align text to left
text-centertext-align: center;Center align
text-righttext-align: right;Align text to right
text-justifytext-align: justify;Justify text

Example:

<p class="text-center">  This text is centered.</p>

2. Text Color (text-{color})

Set the text color using Tailwind’s color palette.

ClassCSS EquivalentDescription
text-blackcolor: #000;Black text
text-whitecolor: #fff;White text
text-gray-500color: #6b7280; (example)Gray shade text
text-red-600color: #dc2626;Red text
text-blue-400color: #60a5fa;Blue text
......Tailwind includes many colors

You can also use arbitrary values:

<p class="text-[#ff5733]">Custom orange text</p>

3. Text Decoration (underline, line-through, no-underline)

Control decorations like underlines and strikethrough.

ClassCSS EquivalentDescription
underlinetext-decoration: underline;Underline text
line-throughtext-decoration: line-through;Strikethrough text
no-underlinetext-decoration: none;Remove underline

Example:

<p class="underline">This text is underlined.</p><p class="line-through">This text is crossed out.</p><p class="no-underline">This text has no underline.</p>

Summary Example:

<p class="text-center text-red-600 underline">  Centered, red, and underlined text.</p>

Want examples with responsive text alignment or color hover effects?

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