tailwind-css
  1. tailwind-css-text-decoration-style

Tailwind CSS Text Decoration Style

The text-decoration-style property in Tailwind CSS helps to define the style of the text decoration such as underline or line-through.

Syntax

Here's the syntax for using the text-decoration-style property in Tailwind CSS:

<span class="text-<decoration>-<style>">...</span>

Example

Let's see an example of using the text-decoration-style property in Tailwind CSS:

<span class="text-underline-dotted">Hello, world!</span>

Output

The above example will render the text "Hello, world!" with an underline that has dotted style.

Explanation

The text-decoration-style property is used to define the style of the text decoration. The <decoration> part of the class name can be one of the following values:

  • underline to set an underline
  • line-through to set a line through the text
  • no-underline to remove the text decoration

The <style> part of the class name can be one of the following values:

  • solid to set a solid line style
  • dashed to set a dashed line style
  • dotted to set a dotted line style
  • double to set a double-line style
  • wavy to set a wavy line style
  • none to remove the text decoration style

Use

You can use the text-decoration-style property to add or remove the style of the text decoration in your web pages. You can use it to add visual emphasis to your text elements or to indicate changes or updates.

Important Points

  • The text-decoration-style property only defines the style of the text decoration and not the position or color.
  • You can combine the text-decoration-style property with other Tailwind CSS classes such as text-red-500 to define the color of the text decoration.

Summary

The text-decoration-style property in Tailwind CSS is used to define the style of the text decoration such as underline or line-through. You can use it to add visual emphasis to your text elements or to indicate changes or updates. The <decoration> part of the class name can be underline, line-through, or no-underline, while the <style> part can be solid, dashed, dotted, double, wavy, or none.

Published on: