html - Symfony 1.4 布局页脚故障 : Footer div is echoed out with $sf_content

标签 html css layout symfony-1.4 footer

我的应用程序有一个非常简单的布局。页眉、主要内容和页脚。从语义上讲,它们是这样呈现的:

<body>
<div id = "header"> </div>
<div id = "content"> </div>
<div id = "footer"> </div>
</body>

相应的 CSS 也非常基础:

#header{
width:100%;
min-height:10%;
}
#center{
width:100%;
min-height:80%;
}
#footer{
width:100%;
min-height:10%:
}

如您所知,在布局页面中,内容是如何呈现的:

<div id= "content">
<?php echo $sf_content; ?> 
</div>

以上所有内容都非常好,并且按预期呈现。但是这有一个小故障,我输入 <?php echo $sf_content; ?> 的那一刻页脚作为内容的一部分包含在内,而不是作为 #content 标记之后的 div。

基本上,我明白了:

<div id = "header"></div>
<div id = "content>
   <div id ="symfony_template_to_be_rendered">
    <!-- all web application related content like forms etc. -->
   </div>
   <div id = "footer">Footer material
   </div>
</div>

如您所见,出于某种奇怪的原因,页脚随着 symfony 内容一起向上移动。显然这是一个小故障,因为如果我从我的布局中的 div 标签中删除 php 散列 $sf_content 部分,那么页脚会按照应有的位置呈现自己,并且所有内容都会占用所需的尺寸。

这是怎么回事?

最佳答案

我的愚蠢问题。这是一个非常微不足道的问题,我没有关闭我的一个模板中的 HTML 标签,这无意中弄乱了我的页脚。这个问题的答案:请在发布诸如此类的问题之前正确关闭 HTML 标签 :)

关于html - Symfony 1.4 布局页脚故障 : Footer div is echoed out with $sf_content,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13547311/

相关文章:

javascript - 我如何将我的 Logo 放在空间背景的顶部?

layout - 如何在杂志/报纸等砌体布局中 float 元素?

html - 我可以用什么来替换 HTML 中的内容?

javascript - 在特定时间更改 div 的内容

html - 为什么基金会有时不平等地调整列的大小?

php - 将属性添加到通过 wp_register_style 生成的链接标记?

android:如何使 subview 与父 View 重叠?

php - HTML5 表单必需属性不显示输入类型单选消息

html - 在 Bootstrap 输入字段中放置清除按钮

css - 这个 .something.something 选择器在 css 中意味着什么?