gpt4 book ai didi

css - 图片和 div 标签之间的间隙

转载 作者:行者123 更新时间:2023-12-01 22:38:38 24 4
gpt4 key购买 nike

所以我在 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;
}

我去掉了菜单按钮规则,因为它又长又不相关。

最佳答案

在你的<img> :

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

关于css - 图片和 div 标签之间的间隙,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18907613/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com