Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
html页脚不';行不通_Html_Css_Ruby On Rails_Footer - Fatal编程技术网

html页脚不';行不通

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

当我写这篇文章时,Hello一词出现在我的页面顶部而不是底部:

<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{}