Php 网页顶部的空白区域

Php 网页顶部的空白区域,php,html,css,smarty,template-engine,Php,Html,Css,Smarty,Template Engine,什么可能导致页面顶部出现空白 我想提供照片澄清,但由于在stackoverflow的低声誉,我无法上传它。我使用Smarty作为php模板引擎 <html> <head> {include file="_js.tpl"} <title>{$title|escape}</title> <meta http-equiv="content-type" content="text/html; c

什么可能导致页面顶部出现空白

我想提供照片澄清,但由于在stackoverflow的低声誉,我无法上传它。我使用Smarty作为php模板引擎

<html>
    <head>
        {include file="_js.tpl"}
        <title>{$title|escape}</title>
        <meta http-equiv="content-type" content="text/html; charset=utf-8">
        {literal}
            <style type="text/css">
                body{
                    margin:0;
                    padding:0;
                    display: block;
                    font-family: arial;
                }

                #main_iframe 
                {
                    position: relative;
                    width: 100%;
                    height:665px;
                    border:0px;         
                }

                #iframe_setting{
                    padding-left: 220px;
                    background: url('{/literal}{$vir_img}{literal}background.png');
                }
                #content-wrapper{
                    height: 665px;
                    padding-left: 10px;

                }

            </style>

            <script type="text/javascript">
                $(document).ready(function(){
                    $("button#logout").click(function(){
                        window.location = "{/literal}{$url_app}{literal}?m=account&c=do_logout";
                    });

                });

                function go(loc)
                {
                    document.getElementById('main_iframe').src=loc;
                }

                function go3(loc)
                {
                    document.getElementById('iframeid').src=loc;
                }
            </script>
        {/literal}
    </head>
        <body>{include file="header.tpl"}
                <div style="position:absolute;z-index: 999;">
                    {include file="sidebar.tpl"}
                </div>
                    <div id="iframe_setting">
                        <div id="content-wrapper">
                            {$content}
                        </div>
                    </div>
                    {include file="footer.tpl"}
        </body>
</html>

{include file=“_js.tpl”}
{$title | escape}
{literal}
身体{
保证金:0;
填充:0;
显示:块;
字体系列:arial;
}
#主框架
{
位置:相对位置;
宽度:100%;
身高:665px;
边界:0px;
}
#ifu设置{
左侧填充:220px;
背景:url({/literal}{$vir_img}{literal}background.png');
}
#内容包装器{
身高:665px;
左侧填充:10px;
}
$(文档).ready(函数(){
$(“按钮#注销”)。单击(函数(){
window.location=“{/literal}{$url\u app}{literal}?m=account&c=do\u logout”;
});
});
功能go(loc)
{
document.getElementById('main_iframe')。src=loc;
}
功能go3(loc)
{
document.getElementById('iframeid')。src=loc;
}
{/literal}
{include file=“header.tpl”}
{include file=“sidebar.tpl”}
{$content}
{include file=“footer.tpl”}
使用,确保此文件中包含的所有文件以及文件本身都是“以UTF-8编码,无BOM”。为此,请执行以下操作:

在Notpad++->(菜单)编码->(单击)在不带BOM的UTF-8中编码


如果使用UTF8字符并将文件保存为UTF8,则通常会发生这种情况。然后,将有三个不可见的字符导致空白。

请发布呈现的HTML。你可以包括一个链接到你的图像,有足够代表性的人可以嵌入它。你可以使用任何可用的css重置。只需谷歌“css reset”,或者你可以做body,html{margin:0;padding:0;}你真的需要在浏览器中呈现html(查看源代码或类似的东西),而不是在它通过模板引擎之前显示html。据我所知,这个模板引擎可能会把整个网站搞得天翻地覆。我已按你说的把文件交出来了。你可以从我的投递箱下载