Open In App

Tailwind CSS Vertical Alignment

This class accepts more than one value in tailwind CSS. All the properties are covered in class form. It is the alternative to the CSS vertical-align property. This class is used to specify the vertical alignment of the table-box or inline element.

Vertical Alignment classes:



Syntax:

<element class="align-{Vertical Alignment}">...</element>

Example:






<!DOCTYPE html> 
<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 Text Overflow Class</b
    <div class="mx-4 h-24 rounded-lg grid grid-cols-2 text-left ">
      
      <p>
        <img src
             class="inline-block align-baseline">
             align-baseline
      </p>
  
      
      <p>
        <img src
             class="inline-block align-top">
             align-top
      </p>
  
      
      <p>
        <img src
             class="inline-block align-middle">
             align-middle
      </p>
  
      
      <p>
        <img src
             class="inline-block align-bottom">
             align-bottom
      </p>
  
      
      <p>
        <img src
             class="inline-block align-text-top">
             align-text-top
      </p>
  
      
      <p>
        <img src
             class="inline-block align-text-bottom">
             align-text-bottom
      </p>
  
    </div>
</body
  
</html

Output:


Article Tags :