This class accepts lots of value in tailwind CSS in which all the properties are covered as in class form. It is the alternative to the CSS font-style property. If we want to give design to any type of text then we can make the use of Tailwind CSS font style class. It helps to make a better user experience.
Font Style classes:
italic: This class is used to set the font style as italic.
Syntax:
<element class="italic">...</element>
Example:
HTML
<!DOCTYPE html>
< head >
< link href =
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 Font Style Class</ b >
< div class = "mx-24 bg-green-200" >
< p class = "p-4 italic text-justify" >
Geeksforgeeks: A Computer Science portal
for Geeks those who wants to pursue an engineering
degree or wants to create a career on engineering field.
</ p >
</ div >
</ body >
</ html >
|
Output:

italic font style
non-italic: This is basically the default font, which is used to reset italic text at different breakpoints.
Syntax:
<element class="non-italic">...</element>
Example:
HTML
<!DOCTYPE html>
< head >
< link href =
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 Font Style Class</ b >
< div class = "mx-24 bg-green-200" >
< p class = "p-4 non-italic text-justify" >
Geeksforgeeks: A Computer Science portal
for Geeks those who wants to pursue an engineering
degree or wants to create a career on engineering field.
</ p >
</ div >
</ body >
</ html >
|
Output:

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape,
GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out -
check it out now!
Last Updated :
07 Oct, 2022
Like Article
Save Article