DEV Community

Cover image for Tailwind CSS tutorial #17: Font Style
Shubhi✨
Shubhi✨

Posted on

2 1

Tailwind CSS tutorial #17: Font Style

In the article, we will go into detail on how to use font-style.

Font style

Format

text-{italic | not-italic}

Alignment Tailwind Class CSS Property
Italic italic font-style: italic;
Not-italic not-italic font-style: normal;

Italic

This class is used to set the font style as italic.

Not-italic

This is basically the default font, which is used to reset italic text at different breakpoints.

Code

<ul class="container mx-auto leading-none divide-y divide-gray-400 divide-dotted" style="font-family: Raleway">
  <li class="flex items-center justify-between px-4 py-2">
    <div>
      <div class="italic font-light text-5xl align-middle mb-2">Hello World</div>
    </div>
    <div class="text-xs font-semibold font-mono whitespace-nowrap px-2 py-1 ml-5 rounded text-white bg-pink-500 rounded-2">italic   </div>
  </li>
  <li class="flex items-center justify-between px-4 py-2">
    <div>
      <div class="subpixel-antialiased font-light text-5xl align-middle mb-2">Hello World</div>
    </div>
    <div class="text-xs font-semibold font-mono whitespace-nowrap px-2 py-1 ml-5 rounded text-white bg-pink-500 rounded-2">not-italic   </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!! 💛

Tiugo image

Modular, Fast, and Built for Developers

CKEditor 5 gives you full control over your editing experience. A modular architecture means you get high performance, fewer re-renders and a setup that scales with your needs.

Start now

Top comments (0)

Jetbrains image

Build Secure, Ship Fast

Discover best practices to secure CI/CD without slowing down your pipeline.

Read more

👋 Kindness is contagious

If this article connected with you, consider tapping ❤️ or leaving a brief comment to share your thoughts!

Okay