将CSS应用于页脚内的锚点

问题描述 投票:0回答:1

我正在做作业,但似乎无法将样式应用于页脚内的锚元素。这是我的HTML-

<footer>
  <div class="footer-content">
    <h3>Sweet Eats Bakery</h3>
    <nav>
      <a href="#">About</a>
      <a href="#">Cookies</a>
      <a href="#">Weddings</a>
      <a href="#">Catering</a>
      <a href="#">Contact</a>
    </nav>
    <p class="copyright">&copy; Sweet Eats 2018</p>
  </div>
</footer>

我尝试了页脚导航和以下配置:

.footer-content nav a {
  margin: 100px;
  color: yellow;
  text-decoration: underline;
}

我在做什么错?

html css anchor footer
1个回答
0
投票

您几乎忘记了将ulli元素放在nav元素之后,应该有一个使用它的标准,这样它才能正常工作。

© www.soinside.com 2019 - 2024. All rights reserved.