【问题标题】:Tailwind CSS - Grid - Children - PositioningTailwind CSS - 网格 - 子级 - 定位
【发布时间】:2021-07-04 02:46:58
【问题描述】:

如何使类别水平居中

我尝试了 justify-self-center,但没有成功

https://play.tailwindcss.com/xTOkLkWyNj

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>

  <body>
    <div class="flex mx-2 space-x-1 h-52 2xl:grid-cols-12 2xl:gap-1 2xl:flex-none">
      <div class="border-black border-2 justify-self-center">
        <label class="font-bold text-center underline">Category</label>
        <select wire:model="category" name="category" class="w-full border-2 border-black">
            <option>test</option>
            <option>test</option>
            <option>test</option>
        </select>
      </div>
    </div>
  </body>
</html>

【问题讨论】:

    标签: tailwind-css


    【解决方案1】:

    请检查以下链接 - https://play.tailwindcss.com/7eFJ0nNXE9

    我在div 中添加了text-center

    <div class="border-black border-2 text-center">
      <label class="font-bold underline">Category</label>
      <select wire:model="category" name="category" class="w-full border-2 border-black">
        <option>test</option>
        <option>test</option>
        <option>test</option>
      </select>
    </div>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-10-30
      • 2021-03-09
      • 1970-01-01
      • 1970-01-01
      • 2021-05-05
      • 2020-06-13
      • 2023-01-16
      相关资源
      最近更新 更多