我正在尝试修复页脚底部的位置。 以下是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