How do I use fixed-top correctly for fixed header

2019-08-04 17:21发布

问题:

How do I use fixed-top correctly for fixed header in Bootstrap4

It works apart from its cut-off the top of the rest of the page, have I got to set a height or something somewhere. I tried fixed-sticky but when tried it on my phone it worked to start with showing th etop of the page but as I scolled further down the sticky header disappeared.

<div class="fixed-top bg-light">
<div>
  <noscript>
      <h1 style="color:#FF0000;">
          This reportFile will not be navigable without Javascript, please enabled Javascript
      </h1>
  </noscript>
  <img srcset="style/songkongheader.png 400w,style/songkongheader-medium.png 200w,style/songkongheader-small.png 100w," sizes="(max-width:800px) 200px,(max-width:600px) 100px,400px" class="mb-2">
</div>
<header>
  <h2 class="subheading" title="Start Fixing Songs">
      <a class="mx-2">
          Fix Songs
      </a>
  </h2>
</header>
</div>