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!! 💛

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more