页面底部有额外空间

时间:2013-05-01 23:52:53

标签: html css space

由于某些原因,我页面底部有一大堆额外的空白区域,我似乎无法摆脱它。我不能把任何东西放在空间里也不能摆脱它。我做了一些研究,我有预感,因为我的图像是position:relative,但我还是不完全确定。如果我需要摆脱position:relative,有人可以告诉我如何放置不使用position:absoluteposition:relative的图片吗?

<!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">
<head>
<link rel="stylesheet" type="text/css" href="SDL.css">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Home</title>
</head>

<body>
<center>
<img src="img/SDL 4 Final Recompress.jpg" height="283" style="position: relative;"/>
<br/>
<hr width="500"/>


<img src="img/Studio-Light_sxu1.png"         style="position: relative; top: -496px; left:  30px; z-index: 3; height: 200px;"/>
<img src="img/Studio-Light_sxu1 flipped.png" style="position: relative; top: -496px; left: 650px; z-index: 3; height: 200px;"/>

<embed
src="http://blip.tv/play/AwGUv2w"
type="application/x-shockwave-flash" width="669"
height="500" allowscriptaccess="always"
allowfullscreen="true" wmode="transparent" style="position:relative; z-index: 2; top:100px; left:-200px">
</embed>

<img src="img/Stage-Background.png" style="position: relative; z-index: 1; height: 680px; top:-500px"/>
</center>

<div id="nav">
<p>All Episodes</p>
<a>Contact</a>
<a>Facebook</a>
<a>Meet the Crew</a>
</div>





</body>
</html>

2 个答案:

答案 0 :(得分:1)

更改此

<img src="img/Stage-Background.png" style="position: relative; z-index: 1; height: 680px; top:-500px"/>

<img src="img/Stage-Background.png" style="z-index: 1; height: 680px; margin-top:-500px"/>

当你做位置:相对并移动它时,它会使文档的其余部分保持不变,就像你没有移动它一样,所以它必须保持它下面的空间。如果你做了一个负余量顶部,它会拉动图像向下移动的所有东西,随之而来。

答案 1 :(得分:0)

看起来像

<img src="img/Stage-Background.png" style="position: relative; z-index: 1; height: 680px; top:-500px"/>

导致您的问题,请尝试更改

height: 680px;

查看问题是否仍然存在