0

ページ上部の空白スペースの原因として考えられるものは何ですか

明確にするために写真を提供したいのですが、スタックオーバーフローでの評判が低いため、アップロードできませんでした。PHP テンプレート エンジンとして Smarty を使用しています。

<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>
4

1 に答える 1

1

notepad++を使用して、このファイルに含まれるすべてのファイルとそれ自体が「BOM なしの UTF-8 でエンコード」されていることを確認します。これを行うには、次のようにします。

Notpad++ で -> (メニュー) エンコード -> (クリック) BOM なしの UTF-8 でエンコード

これは通常、UTF8 文字を使用し、ファイルを UTF8 として保存した場合に発生します。次に、その空白の原因となる 3 つの非表示文字があります。

于 2013-05-10T04:07:24.290 に答える