max-h-16: Tailwind CSS Height class

The max-h-16 class limits the maximum height of an element to 4rem (64 pixels).


max-h-16

The max-h-16 class limits the maximum height of an element to 4rem (64 pixels). This is useful when you need to ensure elements don’t exceed a certain size.

Code Example

html
<div class="flex justify-center items-center bg-indigo-100 mt-2 rounded-t">
<div class="relative">
<button class="bg-indigo-500 text-white px-4 py-2 rounded">Menu</button>
<ul class="absolute w-40 bg-white shadow-lg rounded max-h-12 overflow-y-auto">
<li class="p-2 hover:bg-indigo-200 cursor-pointer font-medium">Option 1</li>
<li class="p-2 hover:bg-indigo-200 cursor-pointer font-medium">Option 2</li>
<li class="p-2 hover:bg-indigo-200 cursor-pointer font-medium">Option 3</li>
<li class="p-2 hover:bg-indigo-200 cursor-pointer font-medium">Option 4</li>
</ul>
</div>
</div>

Preview

  • Option 1
  • Option 2
  • Option 3
  • Option 4

Windframe is a drag and drop builder for rapidly building tailwind css websites and UIs

Start building stunning tailwind UIs! 

Build from scratch or select prebuilt tailwind templates