我正在嘗試修復頁腳底部的位置。 以下是CSS頁腳沒有固定在自定義類的位置
.footer {
position: fixed;
bottom: 0;
width: 100%;
height: 25px;
}
的代碼,但它不工作,但是當我使用的ID爲這些屬性它的工作原理。
#footer {
position: fixed;
bottom: 0;
width: 100%;
height: 25px;
}
問題是爲什麼我無法使用類來修復頁腳底部的位置。這些屬性有一些規則嗎?請指教。
這裏是上述CSS
<div class="footerBar" style="">
<label class="control-label" style="color: white">Copyright 2007-2017 </label>
<label class="control-label" style="float: right;margin-right: 10px;font-weight: bold;color: white">{{version}}</label>
</div>
的HTML代碼,我使用div在另一個DIV如下
<div id="footer"><!-- calling of class for footer doesn't work for me here -->
<footer-outlet></footer-outlet>
</div>
你能否給我提供鏈接? –
根據你的html你應該使用'.footerBar'而不是'.footer' –
也許有一些其他的CSS規則重載類規則?您是否嘗試瞭解某些瀏覽器開發控制檯如何評估屬性? – Massimo