Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tailwind mobile device hidden is not working

I am trying to hide a div in mobile device, but I am not able to do that, this is my code below

<div class="absolute top-0 inset-x-0 p-2 transition transform origin-top-right sm:hidden">
                <p>asdasd</p>
            </div>

How to do this in tailwind

like image 338
Jithin Zacharia Avatar asked Jan 20 '26 20:01

Jithin Zacharia


2 Answers

Tailwind is mobile first, sm is 576px and above (640px in v1), if you want to make it hidden below md, it should be just <div class="hidden md:block">

like image 173
ali Atwa Avatar answered Jan 22 '26 10:01

ali Atwa


Can you try:

<div class="hidden sm:block">
  <p>asdasd</p>
</div>

Or sm:flex if you want it to be flex.

like image 26
Rick van den Broek Avatar answered Jan 22 '26 08:01

Rick van den Broek