I tried some thing like this
<div className="flex w-full lg:justify-start md:justify-center sm:justify-center sm:items-center">
<Button title={data.title as string}></Button>
</div>
But it is always left aligned on mobile. It should be center on mobile and left on desktop
2
Answers
make sure to add the flex class to the parent container to enable flexbox behavior
In the
div
, use'class'
instead of'className'
and insertjustify-center
as a class.See live: https://play.tailwindcss.com/B0S7FRrWIY