Open In App

Tailwind CSS Text Decoration

Last Updated : 23 Mar, 2022
Improve
Improve
Like Article
Like
Save
Share
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> 
<head
    <link href=
"https://unpkg.com/tailwindcss@^1.0/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> 
<head
    <link href=
"https://unpkg.com/tailwindcss@^1.0/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> 
<head
    <link href=
"https://unpkg.com/tailwindcss@^1.0/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



Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads