<!DOCTYPE html>
<html>
<head>
<title>Risebush|home</title>
</head>
<body bgcolor=linear-gradient(#82FA58, #21610B), >
<div style="color:#61B329">
<div id="header">
<div id="navbar">
<ul>
<li>Home</li>
<li>About Us</li>
<li>Become a Member</li>
<li>Contact Us</li>
<li>Games</li>
<li>Movies</li>
</ul>
</div>
<h1 align="center", style="font-family:cursive"><font size="7">Risebush Website</font></h1>
</div>
</div>
<p style="font-family:cursive">Risebush is awesome! We do things and stuff. We have lots of employees working for us and are rolling in the cash as you read this!</p>
<p style="font-family:cursive">$$$$$ = life</p>
<img src="http://previews.123rf.com/images/pamparam/pamparam0705/pamparam070500006/908484-Rainbow-over-the-green-meadow-and-multicolored-bush-in-bloom-Stock-Photo.jpg" alt="Rainbow over a bush" style="width:304px;height:228px">
<div style="color:#21610B" >
<p></p>
<a href='#' class='button'>Become a member!</a>
</div>
<div style="color:#21610B">
<h1 align="center", style="font-family:cursive"><font size="5">Games</font></h1>
</div>
<p></p>
<div align="center"><embed src="http://www.classicgamesarcade.com/games/flappybirdflash.swf" width="475px" height="665px" autostart="true" loop="false" controller="true"></embed><br /><a href="http://www.classicgamesarcade.com/game/21741/flappy-bird-game.html">Play Flappy Bird</a></div>
<div id="footer">
<p>©2011 Risebush, Azhi Guore</p>
<p>All rights reserved. You may not claim to own Risebush, in any way, shape, or form, or claim that you created this website in any way possible, all rights go to the Risebush Company, owned by Azhi Guore.</p>
</body>
<style media="screen" type="text/css">
.button {
border: 1px solid #0a3c59;
background: #3e779d;
background: -webkit-gradient(linear, left top, left bottom, from(#65a9d7), to(#3e779d));
background: -webkit-linear-gradient(top, #65a9d7, #3e779d);
background: -moz-linear-gradient(top, #65a9d7, #3e779d);
background: -ms-linear-gradient(top, #65a9d7, #3e779d);
background: -o-linear-gradient(top, #65a9d7, #3e779d);
background-image: -ms-linear-gradient(top, #65a9d7 0%, #3e779d 100%);
padding: 14.5px 29px;
-webkit-border-radius: 22px;
-moz-border-radius: 22px;
border-radius: 22px;
-webkit-box-shadow: rgba(255,255,255,0.4) 0 1px 0, inset rgba(255,255,255,0.4) 0 1px 0;
-moz-box-shadow: rgba(255,255,255,0.4) 0 1px 0, inset rgba(255,255,255,0.4) 0 1px 0;
box-shadow: rgba(255,255,255,0.4) 0 1px 0, inset rgba(255,255,255,0.4) 0 1px 0;
text-shadow: #7ea4bd 0 1px 0;
color: #06426c;
font-size: 21px;
font-family: helvetica, serif;
text-decoration: none;
vertical-align: middle;
}
.button:hover {
border: 1px solid #0a3c59;
text-shadow: #1e4158 0 1px 0;
background: #3e779d;
background: -webkit-gradient(linear, left top, left bottom, from(#65a9d7), to(#3e779d));
background: -webkit-linear-gradient(top, #65a9d7, #3e779d);
background: -moz-linear-gradient(top, #65a9d7, #3e779d);
background: -ms-linear-gradient(top, #65a9d7, #3e779d);
background: -o-linear-gradient(top, #65a9d7, #3e779d);
background-image: -ms-linear-gradient(top, #65a9d7 0%, #3e779d 100%);
color: #fff;
}
.button:active {
text-shadow: #1e4158 0 1px 0;
border: 1px solid #0a3c59;
background: #65a9d7;
background: -webkit-gradient(linear, left top, left bottom, from(#3e779d), to(#3e779d));
background: -webkit-linear-gradient(top, #3e779d, #65a9d7);
background: -moz-linear-gradient(top, #3e779d, #65a9d7);
background: -ms-linear-gradient(top, #3e779d, #65a9d7);
background: -o-linear-gradient(top, #3e779d, #65a9d7);
background-image: -ms-linear-gradient(top, #3e779d 0%, #65a9d7 100%);
color: #fff;
}
#footer{
clear: both;
position: relative;
bottom: -20px;
border-bottom-left-radius: 15px;
border-bottom-right-radius: 15px;
height: 95px;
background-color: #3c4543;
}
#navbar {
position:relative;
margin-left:-350px;
top:144px;
left:50%;
}
#header {
position:relative;
top: -50px;
background-color: #3c4543;
border-top-left-radius: 15px;
border-top-right-radius: 15px;
}
ul{
list-style-type: none;
position: relative;
margin: 50px;
}
li {
display: inline;
border: 2px solid #000000;
font-family: Futura, Tahoma, sans-serif;
color: #ffffff;
padding: 5px;
border-radius: 5px 5px;
background-color: #cc0323
}
</style>
</html>
网站看起来很好,但页面右侧有一个巨大的空间。但是,我的编码中没有任何宽度参数,所以我不知道什么可能导致这个巨大的空间。有没有办法我可以删除它而不破坏网站布局?你知道原因可能是什么吗?谢谢你的帮助。
答案 0 :(得分:0)
我在野外检查代码时看到的唯一空间来自HTML body元素的默认边距。尝试将body { margin: 0; }
添加到样式表。
答案 1 :(得分:0)
问题在于relative position
#navbar
。只需删除position:relative
,它就会从右侧移除巨大的空间。然后你需要通过调整margin-left(-350px和所有其他必要的属性)来调整#navbar的位置。