简体   繁体   English

网页顶部的空白区域

[英]Blank white space on top of the webpage

What could the possible cause blank space on top of the page 有什么可能导致页面顶部出现空白

I want to provide photo for clarification but due to low reputation in stackoverflow I couldn't upload it. 我想提供照片以作澄清,但是由于stackoverflow中的信誉不佳,我无法上传它。 I am using Smarty as php template engine. 我正在使用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>

Using notepad++ , make sure that all the files included in this file, as well as itself, are "Encode in UTF-8 without BOM". 使用notepad ++ ,确保此文件中包含的所有文件及其本身都是“在没有BOM的情况下以UTF-8编码”。 To do so, follow as below: 为此,请按照以下步骤操作:

In Notpad++ -> (menu) Encoding -> (click) Encode in UTF-8 without BOM 在Notpad ++中->(菜单)编码->(单击)在没有BOM的UTF-8中编码

This usually happens if you have used UTF8 characters and saved the file as UTF8. 如果您使用过UTF8字符并将文件另存为UTF8,通常会发生这种情况。 Then, there will be three invisible characters which causes that white space. 然后,将出现三个导致该空白的不可见字符。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM