Open In App

Tailwind CSS Text Decoration

Last Updated : 23 Jul, 2025
Comments
Improve
Suggest changes
4 Likes
Like
Report

This class accepts more than one value in tailwind CSS. All the properties are covered in class form. It is the alternative to the CSS text-decoration property. This class is used to “decorate” the content of the text. It is essentially decorating the text with different kinds of lines. 

Text Decoration classes:

  • underline 
  • line-through 
  • no-underline 

underline: This class is used to decorate the text with an underline.

Syntax:

<element class="underline ">...</element>

Example:

HTML
<!DOCTYPE html> 
<html>
  
<head> 
    <link href=
"https://unpkg.com/[email protected]/dist/tailwind.min.css" 
          rel="stylesheet"> 
</head> 

<body class="text-center mx-4 space-y-2"> 
    <h1 class="text-green-600 text-5xl font-bold">
        GeeksforGeeks
    </h1> 
    <b>Tailwind CSS Text Decoration Class</b> 
    <div class="mx-14 bg-green-200 p-4">
    	<p class="underline"> 
        	A Computer Science portal for Geeks
    	</p>
    </div>
</body> 

</html> 

Output:

line-through: This class is used to stroke the text.

Syntax:

<element class="line-through">...</element>

Example:

HTML
<!DOCTYPE html> 
<html>
  
<head> 
    <link href=
"https://unpkg.com/[email protected]/dist/tailwind.min.css" 
          rel="stylesheet"> 
</head> 

<body class="text-center mx-4 space-y-2"> 
    <h1 class="text-green-600 text-5xl font-bold">
        GeeksforGeeks
    </h1> 
    <b>Tailwind CSS Text Decoration Class</b> 
    <div class="mx-14 bg-green-200 p-4">
    	<p class="line-through"> 
        	A Computer Science portal for Geeks
    	</p>
    </div>
</body> 

</html> 

Output:

no-underline: This class is used to remove the underline or line-through styling.

Syntax:

<element class="no-underline">...</element>

Example: 

HTML
<!DOCTYPE html> 
<html>
  
<head> 
    <link href=
"https://unpkg.com/[email protected]/dist/tailwind.min.css" 
          rel="stylesheet"> 
</head> 

<body class="text-center mx-4 space-y-2"> 
    <h1 class="text-green-600 text-5xl font-bold">
        GeeksforGeeks
    </h1> 
    <b>Tailwind CSS Text Decoration Class</b> 
    <div class="mx-14 bg-green-200 p-4">
    	<p class="underline no-underline"> 
        	A Computer Science portal for Geeks
    	</p>
    </div>
</body> 

</html> 

Output:

no-underline

Explore