1

For some reason there is a ton of extra white space at the bottom of my page that I cannot seem to get rid of. I cannot put anything inside of the space nor can I get rid of it. I did some research and I have a hunch it has to do with the fact that my images are position:relative but I'm still not entirely sure. If I need to get rid of position:relative, can somebody please tell me how else to place images that doesn't use position:absolute or position: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>
4

2 回答 2

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"/>

当您执行 position: relative 并移动它时,它会使文档的其余部分保持不变,就好像您没有移动它一样,因此它必须保留其下方的空间。如果你做一个负边距顶部,它会拉动图像向下移动的所有内容,以及它。

于 2013-05-02T00:16:54.617 回答
0

看起来像

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

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

height: 680px;

看看问题是否仍然存在

于 2013-05-02T00:02:51.857 回答