2014-01-24 144 views
0

我對我的簡單網絡感到瘋狂。頁面頂部和我的圖片之間存在無法解釋的空間。有人可以解釋我爲什麼嗎?頁面頂部的奇怪邊距

的網址:http://2014.nahollaru.cz/

我的HTML

<body> 
    <img src="img/top.png" border="0" /> 

我的CSS

<style type="text/css"> 
/* --------- demo presentation------------ */ 
body {text-align: center;} 
#header {margin-top:0px; height: 100px; width:800px; margin:0px auto; background: #000;} 
#header p {text-align:center; font-style:italic; color:#fff; font-family:Cambria; font-size:30px;} 
#primary .obsah, #content .obsah, #secondary .obsah {text-align:justify; font-family:Cambria; color:#E6E8E1; font-size:15px; } 
#primary p:hover, #content p:hover, #secondary p:hover {color:black;} 
a{color:#E6E8E1;} 
a:hover{color:black;} 
#footer {padding:5px; height: 20px; width:800px; margin:0px auto; background: #000; color:#fff; font-family:Cambria; font-size:25px;} 
/* --------------------------------------- */ 



/* ----- set width and center layout ----- */ 
#container { 
    width:800px; 
    margin:20px auto; 
} 
/* --------------------------------------- */ 




/* ----------- float columns ------------- */ 
#primary, #content, #secondary { 
    float:left; 
    width:266.667px; 
    height:auto; 
    padding: 50px 0; 
    background-color:#fff; 
    font-family:Cambria; 
    color:#E6E8E1; 
    text-align:justify; 
} 

#primary:hover, #content:hover, #secondary:hover { 
    color:black; 
} 

#primary a:hover{ 
    color:black; 
} 
/* --------------------------------------- */ 




/* --------------------------------------- */ 
#footer { 
    clear:both; 
} 
/* --------------------------------------- */ 
</style> 

在此先感謝。

回答

5

你所看到的是body的默認邊距。就在這個規則添加到您的風格上:

html, body { 
    margin: 0; 
    padding: 0; 
} 
+0

或者最好使用一個不錯復位,這我不能說雖然有一段時間沒有做網頁。 –

+0

謝謝!有效。 –

+0

如果你不使用css框架,我建議你至少把你的網站放在http://html5boilerplate.com上,然後像這樣的東西可以爲你解決。 –