【发布时间】:2011-11-09 17:52:45
【问题描述】:
这就是我的问题的样子:
如您所见,有 3 个图像(div),我不想删除每个 div 之间的黑色间距。
最重要的是,当我在我的 css 中放置以下内容时:
* {
padding: 0;
margin: 0;
}
然后它看起来很好:
问题是我的整个html不能使用padding: 0和margin: 0,因为其他属性会被破坏......
我尝试在每个 div(图像)上添加:padding:0 和 margin:0,但它不起作用。
HTML 源代码:
<div id="sidebar-left" class="sidebar" role="complementary">
<div class="sb-ui sb-title"><h3>Account</h3></div>
<div class="sb-con">
<ul>
<li><a href="index.php?subtopic=accountmanagement">My Account</a></li>
<li><a href="index.php?subtopic=accountmanagement&action=logout">Logout</a></li>
</ul>
</div>
<div class="sb-ui sb-end"></div>
</div>
我的 CSS:
#sidebar-left {
margin-right: 9px;
}
.sidebar {
width: 170px;
position: relative;
bottom: 7px;
}
.sidebar, #content {
float: left;
}
.sb-title {
height: 60px;
text-align: center;
}
.sb-ui {
background: url("../images/ui/sidebar_ui.png");
}
.sb-con {
background: url("../images/ui/sidebar_bgrepeat.jpg") repeat-y;
}
.sb-end {
height: 23px;
background-position: bottom center;
margin-bottom: 10px;
}
.sb-ui {
background: url("../images/ui/sidebar_ui.png");
}
我们将不胜感激所有帮助尝试。
【问题讨论】: