这是我的习俗
@import 'bootstrap/scss/bootstrap';
@import 'bootstrap-icons/font/bootstrap-icons';
footer {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
background-color: red;
color: white;
text-align: center;
}我的页面就像
<body>
<%= render "layouts/navigations"%>
<div class="container">
<%= render "layouts/messages"%>
<%= yield %>
</div>
<%= render "layouts/footer"%>
</body><footer class="footer mt-auto py-3 bg-dark text-center">
<!-- Copyright -->
<div class="text-center p-3 mt-2 text-light" ">
© 2022 Copyright:
</div>
<!-- Copyright -->
</footer>不知道为什么它不能与我的应用程序(但实际上以前工作在我的旧rails 6应用程序。真的很抱歉这个简单的问题,因为我刚刚回来尝试重新学习网络应用程序,并被困在这类问题。
发布于 2022-03-09 11:14:22
在这个例子中,它运行得很好。请提供工作的例子,以便我们可以找到是什么原因造成的问题。
footer {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
background-color: red;
color: white;
text-align: center;
}
.container {
background: #d9fbff;
height: 900px;
padding: 0;
}<html>
<body>
<div class="container">
</div>
<footer class="footer mt-auto py-3 bg-dark text-center">
<div class="text-center p-3 mt-2 text-light">
© 2022 Copyright:
</div>
</footer>
</body>
</html>
https://stackoverflow.com/questions/71407711
复制相似问题