2012-04-26 61 views
1

我觉得这应该是一个超级简单的修复,但它使我疯狂。我试图让这个图像休息在浏览器窗口的顶部,但我得到这个填充上面的图片,我不能摆脱HTML:Image不会回到顶部:(

我已经尝试了一些东西,如设置填充为0,我试过删除一切,但我仍然得到填充任何帮助将不胜感激:)

http://twopairphoto.com/SlapFat/

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en"> 
<head> 
    <style> 

    body{ 
     padding-top: 0px; 
    }  
    div { 
     padding-top: 0px; 
    }  
    </style> 
</head> 
<body background="SlapFatBG_sm.jpg"> 
<div id="container" align="center"><img src="slapfatsplash_sm.jpg" /></div> 
</body> 
</html> 

感谢

回答

1

设置的空白为0,也:

body { 
     padding-top: 0px; 
     margin:0; 
} 
+0

Ahh margin!我知道这很简单。非常感谢:D – 2012-04-26 16:31:38

0
<body style="margin: 0px auto;"> 

body { 
    padding-top: 0px; 
    margin: 0px auto; 
} 

这将摆脱对,默认情况下是它们在屏幕的顶部和底部的余量。这也会将您的内容置于大多数浏览器中,因为将左右页边距设置为自动。

0

尝试在div改变padding-topmargin-top

这应该有助于

0

你可以试试绝对定位...

div {position:absolute; top:0px;} 
0

试试这个:

body{ 
    padding-top: 0px; 
    margin-top: 0px; //<---- Set body margin to 0px 
} 

确认与Firefox。