ページの高さにかかわらず、フッタを下にしておきたいと思います。私はバックグラウンドのためにlinear gradient
を追加するまでこれを行うことができました。 linear gradient background color
でページ全体を埋めるためにhtml div
にmin-height:100%;
を追加する必要がありました。しかし、今では私のフッタにはその下に空白があり、完全に下にはありません。min-height:HTMLの `div`の100%がフッタをぼやけます
私の高さは、フッタは右働く一番下までスクロールするのに十分な長さであるページ..
高さは、ナビゲーションバーをスクロールせずにページ全体でのページはその下のスペースを持っているようです。フッタの前にどんなdivが来ても、それは下に張っているように見えます。
html {
min-height: 100%;
}
body {
background: linear-gradient(45deg, rgb(51, 173, 255), rgb(128, 255, 212))no-repeat;
margin: 0;
height: 100%;
}
#wrap {
min-height: 100%;
}
#main {
overflow: auto;
padding-bottom: 200px;
}
/* must be same height as the footer */
#footer {
position: relative;
margin-top: -200px;
/* negative value of footer height */
height: 200px;
background-color: #484848;
opacity: 0.8;
width: 100%;
color: #fff;
clear: both;
}
application.html.erb
<html>
<body style="min-width:1100px;">
<div id="header" style="min-width:1120px;">
<% if content_for?(:navbar) %>
<%= yield(:navbar) %>
<% else %>
<%= render 'shared/navbar' %>
<% end %>
</div>
<div id="wrap">
<div id="main">
<%= render 'shared/message' %>
<%= yield %>
</div>
</div>
<div id="footer" style="min-width:1120px;">
<%= render 'shared/footer' %>
</div>
</body>
</html>
あなたのコードをフォーマットするために学びます。それはトラブルシューティング/メンテナンスを簡単にします。 –
あなたのコードの例はどこかにありますか?コンパイルされたコードをどこかに投稿して、それが動作しているのを見ることができますか? –