Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

266
Visualizações
Div doesn't Hide on Safari Tailwind CSS

I have certain images hidden when the screen switches from desktop to mobile within ReactJS/Tailwind by doing:

<div className="flex shrink flex-row justify-between w-[60%] h-[25%] sm:w-[95%] sm:h-[52%] mb-[-10px] mt-[-15px] lg:mt-0">
                <img src={images.screen1d} className=" flex mx-auto lg:h-[105%] h-[115%] hover:scale-110 duration-500 cursor-pointer"/>
                <video autoPlay muted loop className=" hidden lg:block flex mx-auto rounded-xl hover:scale-110 duration-500 cursor-pointer">
                    <source src={images.screen3} type="video/mp4" ></source>
                </video>
                <img src={images.screen2} className=" flex lg:h-[105%] h-[115%] mx-auto hover:scale-110 duration-500 cursor-pointer" />
            </div>

More specifically, this line in particular:

<video autoPlay muted loop className=" hidden lg:block flex mx-auto rounded-xl hover:scale-110 duration-500 cursor-pointer">

What I assume happens is that the video is hidden from all screen sizes minus large ones, hence lg:block; this is true for my laptop and desktop, as well as mobile phone, however, when I open the same window in Safari, it still displays the video, regardless of the dimensions of the Safari window (nothing disappears when I shrink the window, and even when I enlarge it, everything is pushed off of the page). I've tried swapping lg out with md, sm, even modifying the minimum width that lg specifies to a higher number, such as 1300px, and it still doesn't hide it on the browser.

This is exclusively for Safari, works fine on every other browser.

EDIT: I've noticed that when I decrease the browser's dimensions in, say, chrome, the div that contains the img/video containers shrink with it as far as they can, until video disappears. This, however, is NOT the case with Safari, it doesn't shrink what so ever to attempt to fit each image, it just pushes it off the page entirely.

What it looks like on Safari (Desktop): enter image description here

Every other browser: enter image description here

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I'm not sure offhand which takes precedence when using Tailwind utility classes, but you have three values (hidden, block, and flex) that all set the display CSS property (https://developer.mozilla.org/en-US/docs/Web/CSS/display).

You could try removing the flex, if you're not using it:

className="hidden lg:block mx-auto rounded-xl hover:scale-110 duration-500 cursor-pointer"
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda