首页 > 解决方案 > 固定导航栏下的锚点消失

问题描述

我的锚点在我的固定导航栏下消失了这个经典问题。我在 stackoverflow 上尝试了各种解决方案,但都没有奏效。我正在使用弹性盒。因为它是用于 fcc 分配,所以我现在想保留原版 html/css。没有引导程序或 JS。

我还想把我的 flexbox 放在一块 4 个相邻的正方形中。

这可能吗?

我的代码笔在这里。

<main>
<div class="flex-container">

  <div id="womens"class="anchor">Women's</div>
    <div id="mens" class="anchor">Men's</div>
  <div id="apparel" class="anchor">Apparel</div>
 <div id="accessories" class="anchor">Accessories</div>
</div>
<div id="reviews" class="anchor">
<h2>PRODUCT REVIEWS</h2><iframe width="560" height="315"  id="video" src="https://www.youtube.com/embed/S1ny0G1FaDI" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></div>
<div class="grid-item"><h2>SUBSCRIBE</h2>
  <p>If you would like to be kept upto date with our latest news, products and offers, enter your email address in the space below.</p>
</div>

标签: htmlcssflexbox

解决方案


推荐阅读