HTML

2013-10-10 46 views
0

頂部有一個空行我正在做一些Google map API,包括markclusterer js庫。HTML

我沒有輸入代碼中的空白行,但它出現在<body>上。截圖:

Screenshot

它出現在每一個瀏覽器,不僅在Chrome瀏覽器的屏幕截圖。

這是我的代碼。這是寫在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> 

請給我一個建議。 謝謝。

+0

的DOM。 – Pointy

+1

問題可能出在您的一個CSS文件中。在你的一個元素內尋找一個邊距和/或填充「頂部」。或者它可能是一個換行符。一個空白的'div'或'p'元素也會導致這種情況。此外,所提及的'mplungjan'也是有意義的。 –

+0

但是,在文檔類型之前,您可能會有一定的空白空間 – mplungjan

回答

0

爲什麼你的div在這一行中有結尾?

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

應該

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

不知道它的問題,但如在屏幕截圖看起來與你貼什麼不同在這裏值得一試的