【问题标题】:nav bar alignment tailwind left and right not equal导航栏对齐顺风左右不相等
【发布时间】:2021-08-01 20:31:02
【问题描述】:

这是导航栏的图像

这是我的代码:

<nav class="Vdark-2 shadow-xl">
  <div class="container mx-28 ">
    <div class="relative flex items-center h-16 justify-between">
      <div class="Vwhite-text text-4xl ml-10 myfont text-left">The Name of my website</div>

      <div class="text-right">
        <span class="Vwhite-text text-xl myfont mx-10">Home</span>
        <span class="Vwhite-text text-xl myfont mx-10">________</span>
        <span class="Vwhite-text text-xl myfont ml-10">______</span>
      </div>
    </div>
  </div>
</nav>

我的问题是,为什么两边不相等?

【问题讨论】:

    标签: css tailwind-css


    【解决方案1】:

    您的边距有一个固定值,因此您的容器不会自动居中

    &lt;div class="container mx-28 "&gt; 更改为&lt;div class="container mx-auto"&gt;

    应该做的伎俩

    【讨论】:

      猜你喜欢
      • 2022-07-15
      • 1970-01-01
      • 1970-01-01
      • 2022-09-28
      • 1970-01-01
      • 2018-07-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多