html页脚不';行不通
当我写这篇文章时,Hello一词出现在我的页面顶部而不是底部:html页脚不';行不通,html,css,ruby-on-rails,footer,Html,Css,Ruby On Rails,Footer,当我写这篇文章时,Hello一词出现在我的页面顶部而不是底部: <footer> Hello </footer> 我真的不知道怎么了。 我在RubyonRails下工作,我正在使用Pdfkit将我的html页面转换成pdf,但我认为这不重要。 页脚是html中的标记,不是类,所以 footer { position:fixed; bottom:0; left:0; height:100px; width: 100%; ba
<footer> Hello </footer>
我真的不知道怎么了。
我在RubyonRails下工作,我正在使用Pdfkit将我的html页面转换成pdf,但我认为这不重要。
页脚是html中的标记,不是类,所以
footer {
position:fixed;
bottom:0;
left:0;
height:100px;
width: 100%;
background: black;
}
在CSS中,将
.footer
替换为footer
,它将工作,工作小提琴在这里
请澄清一下
在html中,我们创建标记,其中一些具有属性,如class
和id
。下面显示了如何分配CSS
如果class
是属性,则使用
<div class="new"/>
CSS would be
.new{}
如果css直接位于标记上,没有属性,则直接使用标记。(这就是你被卡住的地方)
CSS将是
div{}
编码快乐 只需使用footer{…}而不是.footer,它不是一个类,而是一个标记。
<div class="new"/>
CSS would be
.new{}
<div id="new"/>
CSS would be
#new{}
<div/>
CSS would be
div{}