【发布时间】:2022-01-17 04:58:11
【问题描述】:
我有一个菜单,当屏幕较小时(比如说在 SM 之前),我希望将其定位在屏幕左侧,而在屏幕较大时将其定位在右侧。
<MenuItems
class="
absolute left-2 top-24 w-full mt-8
sm:right-2 sm:top-0 sm:w-max
"
>
right-* 的设置在单独应用时按预期工作,但以断点为前缀时 sm left-* 优先。
这是一种使用会在更大屏幕上取消的东西的方法吗?喜欢sm:left-none
【问题讨论】:
-
基于stackoverflow.com/questions/10245729/… 我发现
sm:left-auto可以工作
标签: css css-position tailwind-css