DEV Community

Cover image for Tailwind CSS tutorial #26: Text Decoration
Shubhi✨
Shubhi✨

Posted on

3

Tailwind CSS tutorial #26: Text Decoration

In the article, we will go into detail on how to use Text Decoration.

Text Decoration

Format

text-decoration-line-{underline|overline|line-through|no-underline}

Tailwind Class CSS Property
underline text-decoration-line: underline;
overline text-decoration-line: overline;
line-through text-decoration-line: line-through ;
no-underline text-decoration-line: no-underline;

Control how text is decorated with the underline, no-underline, andline-through utilities.

Code

 <ul class="container mx-auto divide-y divide-gray-400 divide-dotted" style="font-family: Raleway">
  <li class="flex items-center justify-between px-4 py-2">
    <ul class="underline">
    <li>Now this is a story all about how, my life got flipped-turned upside down</li>
    </ul>
    <div class="text-xs font-semibold font-mono whitespace-nowrap px-2 py-1 ml-5 rounded text-white bg-pink-500 rounded-2">underline    </div>
  </li>
  <li class="flex items-center justify-between px-4 py-2">
    <ul class=" overline    ">
    <li>Now this is a story all about how, my life got flipped-turned upside down</li>
    </ul>
    <div class="text-xs font-semibold font-mono whitespace-nowrap px-2 py-1 ml-5 rounded text-white bg-pink-500 rounded-2">overline </div>
  </li>
    <li class="flex items-center justify-between px-4 py-2">
    <ul class=" line-through        ">
    <li>Now this is a story all about how, my life got flipped-turned upside down</li>
    </ul>
    <div class="text-xs font-semibold font-mono whitespace-nowrap px-2 py-1 ml-5 rounded text-white bg-pink-500 rounded-2">line-through     </div>
  </li>
    <li class="flex items-center justify-between px-4 py-2">
    <ul class=" no-underline        ">
    <li>Now this is a story all about how, my life got flipped-turned upside down</li>
    </ul>
    <div class="text-xs font-semibold font-mono whitespace-nowrap px-2 py-1 ml-5 rounded text-white bg-pink-500 rounded-2">no-underline     </div>
  </li>
</ul> 
Enter fullscreen mode Exit fullscreen mode

Full code:
The overall code will be attached to repo link.

Overall Output
Image description

Resources:
tailwind.css

Thank you for reading :), To learn more, check out my blogs on Flex Direction, Hackathons and Flex Wrap.
If you liked this article, consider following me on Dev.to for my latest publications. You can reach me on Twitter.

Keep learning! Keep coding!! 💛

Sentry blog image

How to reduce TTFB

In the past few years in the web dev world, we’ve seen a significant push towards rendering our websites on the server. Doing so is better for SEO and performs better on low-powered devices, but one thing we had to sacrifice is TTFB.

In this article, we’ll see how we can identify what makes our TTFB high so we can fix it.

Read more

Top comments (0)

The Most Contextual AI Development Assistant

Pieces.app image

Our centralized storage agent works on-device, unifying various developer tools to proactively capture and enrich useful materials, streamline collaboration, and solve complex problems through a contextual understanding of your unique workflow.

👥 Ideal for solo developers, teams, and cross-company projects

Learn more