首页 > 解决方案 > 页脚未放大/扩展

问题描述

我创建了一个网站,我想扩展我的页脚,因为现在它看起来像这样: 在此处输入图像描述

它应该覆盖整个网站,我尝试增加宽度,但这不起作用。

这是页脚的 HTML/CSS:

#footer {
  background: #f7f8f9;
  color: #45505b;
  font-size: 14px;
  text-align: center;
  padding: 30px 0;
}

#footer h3 {
  font-size: 36px;
  font-weight: 700;
  position: relative;
  font-family: "Poppins", sans-serif;
  padding: 0;
  margin: 0 0 15px 0;
}

#footer p {
  font-size: 15;
  font-style: italic;
  padding: 0;
  margin: 0 0 40px 0;
}

#footer .social-links {
  margin: 0 0 40px 0;
}

#footer .social-links a {
  font-size: 18px;
  display: inline-block;
  background: #0563bb;
  color: #fff;
  line-height: 1;
  padding: 8px 0;
  margin-right: 4px;
  border-radius: 50%;
  text-align: center;
  width: 36px;
  height: 36px;
  transition: 0.3s;
}

#footer .social-links a:hover {
  background: #0678e3;
  color: #fff;
  text-decoration: none;
}

#footer .copyright {
  margin: 0 0 5px 0;
}

#footer .credits {
  font-size: 13px;
}
 <footer id="footer">
    <div class="container">
      <h3>My name</h3>
      <p></p>
      <div class="social-links">
        <a target="_blank" rel="noopener noreferrer" href="https://www.linkedin.com/in/kaustubh-prabhakar/" class="linkedin"><i class="bx bxl-linkedin"></i></a>
        <a target="_blank" rel="noopener noreferrer" href=href="https://github.com/SantaKaus" class="github"><i class="bx bxl-github"></i></a>
        <a target="_blank" rel="noopener noreferrer" href="https://www.instagram.com/santa_kaus/" class="instagram"><i class="bx bxl-instagram"></i></a>
      </div>
      <div class="copyright">
        &copy; <strong><span>my name</span></strong> 2021
      </div>
    </div>
  </footer><!-- End Footer -->

我从另一个来源获得了整个页脚代码,我尝试复制和粘贴代码,但由于某种原因,我无法让它扩展更多 idk 为什么。你们能帮忙吗?

当您运行上面的代码时,它输出正常,但在我这边,我得到了上面发送的图片中的输出。

出现问题是因为我可能会用它覆盖其他 CSS 元素吗?我有多个 CSS 文件,我尝试更改页脚 CSS 类的名称,但它仍然不起作用。

标签: javascripthtmlcss

解决方案


https://repl.it/@HussainOmer/SantaKausgithubio-3#index.html

您在上一个问题中分享了您的代码。您有具有显示网格属性的主体。

  • 首先,似乎您根本不​​使用网格,您可以删除此属性。
  • 您也可以设置place-itemsstretch达到相同的效果。
  • 似乎只是将页脚的宽度设置为 100% 也可以正常工作

截屏:


推荐阅读