简体   繁体   中英

There is a empty line at the top of HTML

I am making something with google map api including the markclusterer js library.

I did not input the blank line in the code, but it appears on the <body> . Screenshots:

屏幕截图

It appears in every browser, not only Chrome in the screen shot.

Here is my code. It's written in php:

<?
/*
Template Name: map
*/
require_once("map/util.php");
require_once("map/config.php");
?>

<!DOCTYPE html>
<html>
    <head lang="ko">
        <meta charset="utf-8">
        <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
        <style type="text/css">
            html { height: 100% }
            body { height: 100%; margin: 0; padding: 0 }
            #map-canvas { height: 100% }
        </style>
        <link href="../wp-content/themes/att-lefty/map/style.css" rel="stylesheet" />
        <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=true"></script>
        <script type="text/javascript" src="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/src/infobox.js"></script>
        <script type="text/javascript" src="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/src/markerclusterer.js"></script>
        <script type="text/javascript">

        //SOME FUNCTIONS ARE DEFINED IN THIS AREA WITH JS + PHP.

        </script>
    </head>
    <body>
        <div id="wrap" style="height:100%;">
            <div id="map-canvas"/></div>
        </div>
    </body>
</html>

Please give me an advice. Thanks.

why does your div have a closing / in this line?

<div id="map-canvas"/></div>

it should be

 <div id="map-canvas"></div>

not sure if it matters, but worth a try

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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