【问题标题】:X on right side of divdiv右侧的X
【发布时间】:2021-11-01 07:15:45
【问题描述】:

所以,我正在构建一个菜单。它应该是每个项目名称应该在 div 的中间,但 XIcon 需要在右侧(用于关闭项目/div)。这是代码

<div class="hidden sm:block">
      <div class="border-b border-gray-200">
        <nav class="-mb-px flex justify-between" aria-label="Tabs"> 
          <a v-for="tab in tabs" :key="tab.name" :href="tab.href" :class="[tab.current ? 'border-indigo-500 text-indigo-600' : 'border-transparent text-gray-500 hover:text-gray-900 hover:border-gray-300 hover:bg-gray-200', 'w-1/4 py-4 px-1 text-center border-b-2 font-medium text-sm']" :aria-current="tab.current ? 'page' : undefined">
            {{ tab.name }}             <XIcon class="h-6 w-6 text-black" aria-hidden="true" />
          </a>
        </nav>
      </div>
    </div>

我只是不知道最好的方法是什么。

【问题讨论】:

    标签: css flexbox tailwind-css


    【解决方案1】:

    float-right 添加到 XIcon div 修复它

    【讨论】:

      猜你喜欢
      • 2015-04-06
      • 1970-01-01
      • 2017-01-25
      • 2020-12-22
      • 1970-01-01
      • 1970-01-01
      • 2021-09-03
      • 2011-12-28
      • 2012-12-23
      相关资源
      最近更新 更多