這是我的習慣
@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 應用程式中作業過。對于這個簡單的問題真的很抱歉,因為我剛回來嘗試再次學習網路應用程式并遇到此類問題。
uj5u.com熱心網友回復:
在這個例子中作業正常。請提供作業示例,以便我們找到導致問題的原因。
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://www.uj5u.com/shujuku/440310.html
上一篇:我在將段落標題居中時遇到問題
