【问题标题】:Tailwind CSS Card Not going under the navbarTailwind CSS Card 不在导航栏下方
【发布时间】:2021-10-31 10:00:20
【问题描述】:

卡片不在导航栏下方,但是,导航栏是固定的。

卡代码:

<div class="w-full flex justify-center no-wrap">
    <div class="bg-white p-8 rounded-lg shadow-lg relative hover:shadow-2xl transition duration-500">
      <h1 class="text-sm text-gray-400 font-semibold mb-1"><%= @question.question_asked_on %>.</h1>
      <h1 class="text-2xl text-gray-800 font-semibold mb-3"><%= @question.title %>.</h1>
      <div class="w-full">
        <p class="text-gray-600 leading-6 tracking-normal">
          <%= @question.body %>
        </p>
      </div>

      <button class="py-2 px-4 mt-8 bg-indigo-600 text-white rounded-md shadow-xl">Learn  More</button>
    </div>
  </div>
</div>

导航栏代码

<nav class="bg-indigo-700 fixed inset-x-0">
  <div class="max-w-6xl mx-auto px-4">
    <div class="flex justify-between">
      <div class="flex space-x-7">
        <div>

【问题讨论】:

  • 您可以创建一个playground 以便能够尝试代码吗?

标签: tailwind-css ruby-on-rails-6


【解决方案1】:

如果您从卡片中删除 relative,它应该会出现在导航栏下方。

【讨论】:

    猜你喜欢
    • 2021-10-07
    • 1970-01-01
    • 2019-08-14
    • 2021-09-22
    • 1970-01-01
    • 1970-01-01
    • 2021-12-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多