【发布时间】:2015-07-21 20:21:35
【问题描述】:
.heads 和.container1 之间存在一个与h1 标记有关的间隙。在没有 h1 的情况下尝试过,它可以工作,但是我需要 h1。
我将如何消除.heads 和.container1 之间的差距?
http://codepen.io/techagesite/pen/Nqxzvg
.heads {
background-color: #FF9000;
padding: 0px 0px 0px 0px;
border: 1px solid #FFC223;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
border-bottom: none;
border-bottom-right-radius: none;
border-bottom-left-radius: none;
}
h1 {
padding: 0;
font-size: 20px;
font-family: Tekton Pro;
color: #71A00E;
}
.container1 {
width: 100%;
border: 1px solid #006699;
background: #0A3D5D;
float: left;
padding-bottom: 4px;
padding-top: 4px;
padding-right: 0px;
padding-left: 4px;
clear: both;
border-bottom-right-radius: 8px;
border-bottom-left-radius: 8px;
border-top-right-radius: none;
border-top-left-radius: none;
}
p.normal {
font-size: 21px;
font-family: tahoma;
color: #F7DF57;
}
<div class="heads">
<h1>Some heading in here</h1>
</div>
<div class="container1">
<p class="normal">Some text in here</p>
</div>
【问题讨论】:
-
h1 正在添加底部边距.. 所以删除 h1 的边距..