Open In App

Tailwind CSS Font Size

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-size property. This class is used to set the font size of the text in an HTML document.

Font size classes:



Note: Change the size in the component with the required size mentioned above.

Syntax:



<element class="text-size">...</element>

Example:




<!DOCTYPE html> 
<head
    <link href=
"https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" 
          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 Size Class</b
    <div class="mx-24 bg-green-200">
        <p class="text-xs">
            Geeksforgeeks: A Computer Science portal for Geeks
        </p>
  
        <p class="text-sm">
            Geeksforgeeks: A Computer Science portal for Geeks
        </p>
  
        <p class="text-base">
            Geeksforgeeks: A Computer Science portal for Geeks
        </p>
  
        <p class="text-lg">
            Geeksforgeeks: A Computer Science portal for Geeks
        </p>
  
        <p class="text-xl">
            Geeksforgeeks: A Computer Science portal for Geeks
        </p>
  
    </div>
</body
  
</html

Output:


Article Tags :