简体   繁体   English

在 Tailwind CSS 中,justify-self-end 在 Firefox 中不起作用

[英]In Tailwind CSS, justify-self-end doesn't work in Firefox

I am using Tailwind CSS and I have a problem with justify-self-end .我正在使用 Tailwind CSS,但justify-self-end有问题。 It works in Chrome, but not in Firefox.它适用于 Chrome,但不适用于 Firefox。 I have uploaded two pictures so to understand better what's happening.我上传了两张图片,以便更好地了解正在发生的事情。 Is there something I can do to make it work in both browsers?我可以做些什么来让它在两个浏览器中都能正常工作吗?

<section class="lg:grid lg:grid-cols-2 lg:grid-rows-1 lg:h-screen overflow-hidden">
  <div class="justify-self-end bg-[#2e3362] px-[1em] lg:px-[0] mb-[1.875em] lg:mb-0">
    <img
      src="../img/alarm.webp"
      class="alarm cursor-pointer shadow-lg rounded-[1em] lg:rounded-l-full max-w-full h-[90%]"
    />
  </div>
  <div class="bg-[#2e3362] px-[1em] lg:px-[0] mb-[1.875em] lg:mb-0">
    <img
      src="../img/camera.webp"
      class="camera cursor-pointer shadow-lg rounded-[1em] lg:rounded-r-full max-w-full h-[90%]"
    />
  </div>
</section>

Firefox火狐火狐会发生这种情况

Chrome铬合金铬会发生这种情况

I think this will work for you:我认为这对你有用:

<section class="lg:grid lg:grid-cols-2 lg:grid-rows-1 lg:h-screen overflow-hidden">
  <div class="flex justify-end bg-[#2e3362] px-[1em] lg:px-[0] mb-[1.875em] lg:mb-0">
    <img
      src="../img/alarm.webp"
      class="alarm cursor-pointer shadow-lg rounded-[1em] lg:rounded-l-full max-w-full h-[90%]"
    />
  </div>
  <div class="bg-[#2e3362] px-[1em] lg:px-[0] mb-[1.875em] lg:mb-0">
    <img
      src="../img/camera.webp"
      class="camera cursor-pointer shadow-lg rounded-[1em] lg:rounded-r-full max-w-full h-[90%]"
    />
  </div>
</section>

I added flex and justify-end to the first div.我在第一个 div 中添加了 flex 和 justify-end。

Hope it helps.希望能帮助到你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM