Check out our free templates made with AI and polished to perfection in Windframe

Get now

px-2: Tailwind CSS padding class

The px-2 class applies padding of 0.5rem (8px) to the left and right sides of an element.


px-2 (Horizontal Padding 2)

The px-2 class applies padding of 0.5rem (8px) to the left and right sides of an element.

Example Code

html
<div class="px-2 bg-red-400 text-white">
Horizontal padding of 0.5rem
</div>

Preview

Horizontal padding of 0.5rem

Windframe is an AI visual editor for rapidly building stunning web UIs & websites

Start building stunning web UIs & websites!

Build from scratch or select prebuilt tailwind templates