简体   繁体   English

如何使页脚覆盖屏幕的整个宽度?

[英]How do I make the footer cover the whole width of the screen?

I would like the footer to cover the whole width of the screen.我希望页脚覆盖整个屏幕宽度。 This is how it looks right now:这是它现在的样子:
Footer页脚

I would appreciate help!我会很感激帮助!

  <!-- Footer -->
  <div class="container">
    <footer class="py-5 bg-dark" id="footer">
      <p class="m-0 text-center text-white">&copy; X <script>document.write(new Date().getFullYear());</script>. This website was made with Bootstrap.</p>
    </footer>
  </div>

Just take it out from the .container只需从.container中取出

<!-- Footer -->    
<footer class="py-5 bg-dark" id="footer">
  <p class="m-0 text-center text-white">&copy; X <script>document.write(new Date().getFullYear());</script>. This website was made with Bootstrap.</p>
</footer>

or if you need .container inside a footer或者如果您需要在footer.container

<footer class="py-5 bg-dark" id="footer">
  <div class="container">
    <p class="m-0 text-center text-white">&copy; X <script>document.write(new Date().getFullYear());</script>. This website was made with Bootstrap.</p>
  </div>
</footer>

You can put that container div tag inside footer您可以将该容器div标签放在footer

So that all the content of footer will be in container while the footer will be having 100% width这样页脚的所有内容都将在容器中,而页脚将具有 100% 的宽度

<footer class="py-5 bg-dark" id="footer">
  <div class="container">
    <p class="m-0 text-center text-white">&copy; X <script>
      document.write(new Date().getFullYear());
    </script>. This website was made with Bootstrap.</p>
  </div>
</footer>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM