rony l
rony l

Reputation: 6002

In Tailwindcss, how do I set a margin for the smallest screen only, and leave the rest screen sizes untouched

In my specific case i want

<div className="mx-auto"...</div>

but only if the screen is the smallest. Doing:

<div className="sm:mx-auto"...</div>

will have the opposite affect (of setting margin to auto for small screens and up).

Upvotes: 5

Views: 3772

Answers (1)

Bets
Bets

Reputation: 586

As of Tailwind 3.2 you can use max-sm:mx-auto to achieve what you want. More info can be found here.

Upvotes: 9

Related Questions