tailwindcss警报悬停在固定导航上

时间:2018-04-22 20:37:19

标签: html css tailwind-css

我有一个我正在使用Rails 5,Ruby 2.4构建的Web应用程序。我使用Tailwindcss作为我的设计框架。

我有一个英雄形象(下图),其中我使用顺风警报作为横幅来宣传新的网上商店。它正好位于我希望它成为英雄的地方,但是在页面滚动它漂浮在我的固定导航上,并且在移动视图中,导航菜单下降它漂浮在它上面阻挡导航视图。

我不太确定如何解决这个问题,因此它位于导航器和dosnt后面,阻碍了导航功能。

链接到网站以供查看 Loadlead website

我的英雄形象代码:

<div class="flex flex-wrap sm:block bg-transparent" id="header-hero">
  <div class="container mx-auto">

    /* BANNER THATS CAUSING ISSUES */
    <div class="bg-transparent text-center py-4 lg:px-4">
      <div class="p-2 bg-load-lead-green items-center text-white leading-none lg:rounded-full flex lg:inline-flex opacity-75 border-b-4 border-black md:mt-8">
        <span class="flex rounded-full bg-blue uppercase px-2 py-1 text-xs font-bold mr-3 border-b-2 border-black">New</span>
        <span class="font-semibold mr-2 text-left flex-auto">Pre-order LoadLead gear in our new web store</span>
        <svg class="fill-current opacity-75 h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M12.95 10.707l.707-.707L8 4.343 6.586 5.757 10.828 10l-4.242 4.243L8 15.657l4.95-4.95z"/></svg>
      </div>
    </div>
/* END BANNER */

    <div class="flex py-8 px-4 sm:px-8">
      <div class="w-full py-8">
        <p class="text-4xl text-black font-sans font-bold mb-1">Trucking. Simplified</p>
        <p class="text-xl text-black sm:text-lg mb-6 font-sans font-semibold">Minimize your trucks downtime &amp; keep your loads moving!</p>
        <a class="bg-blue text-white no-underline uppercase text-sm px-4 py-2 rounded-full font-bold hover:bg-blue border border-b-4 border-black hover:border-transparent cursor-not-allowed" href="/#">Take a Tour</a>
        <a class="bg-load-lead-green text-white no-underline uppercase text-sm px-4 py-2 rounded-full font-bold hover:bg-load-lead-green border border-b-4 border-black hover:border-transparent cursor-not-allowed" href="/#">Join the Community</a>
      </div>
    </div>
  </div>
</div>

这里的任何帮助将不胜感激!

1 个答案:

答案 0 :(得分:0)

你需要将你的英雄作为亲戚,将横幅作为绝对位置。