图像和div标签之间的差距

时间:2013-09-20 01:36:52

标签: css html tags space

所以我在dreamworks cc中建立了一个网站,我的图像和div标签之间存在很大差距。见图:

http://i.imm.io/1gzKW.png

好的,现在是我的索引代码:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Home</title>
<link href="style/style.css" rel="stylesheet" type="text/css">
</head>

<body>
<div class="container" style="">
  <div class="logo"><img src="images/header.png" width="990" height="256"  alt=""/></div>
  <div class="menu">
    <div class="menubutt1" style="cursor:pointer;" onclick="location.href='./index.html'">Home</div>
    <div class="menubutt2" style="cursor:pointer;" onclick="location.href='./aboutus.html'">About Us</div>
    <div class="menubutt3" style="cursor:pointer;" onclick="location.href='./games.html'">Game Info</div>
    <div class="menubutt4" style="cursor:pointer;" onclick="location.href='./forms.html'">Forms</div>
    <div class="menubutt5" style="cursor:pointer;" onclick="location.href='./gallery.html'">Gallery</div>
    <div class="menubutt6" style="cursor:pointer;" onclick="location.href='./contactus.html'">Contact Us</div>
  </div>

  <div class="content">stuff</div>
  <div class="footer"><br><strong>©</strong>2013 Trey Zanone</div>
</div>


</body>
</html>

并且继承了我的css样式表:

@charset "utf-8";.container {
    background-image: none;
    width: 990px;
    margin-right: auto;
    -webkit-transition: all;
    -moz-transition: all;
    -ms-transition: all;
    -o-transition: all;
    transition: all;
    margin-left: auto;
    padding: 0px;
    margin-top: 0px;
    margin-bottom: 0px;
}
.content {
    width: 990px;
    margin-right: auto;
    margin-left: auto;
    padding: 30px;
    background-image: url(../images/body.png);
    background-repeat: repeat-y;
    margin-top: 0px;
    margin-bottom: 0px;
}
.footer {
    background-image: url(../images/footer.png);
    width: 990px;
    height: 100px;
    text-align: center;
    margin: 0px;
    padding: 0px;
}
body {
    background-image: url(../images/background.png);
    background-repeat: repeat-x;
    margin-top: 0px;
}
img {
    border:0;
    margin:0
}
.logo {
    background-image: none;
    padding: 0px;
    margin-top: 0px;
    margin-right: auto;
    margin-bottom: 0px;
    margin-left: auto;
}
.menu {
    height: 48px;
    width: 934px;
    margin-top: 0px;
    margin-right: auto;
    margin-bottom: 0px;
    margin-left: auto;
}

我拿出了菜单按钮规则,因为它很长且无关紧要。

1 个答案:

答案 0 :(得分:4)

<img>

img {
    border: 0;
    margin: 0;
    display: block;
}