我需要删除线条和图片之间的空白。在屏幕截图中,可以看到在线的底部一切正常,但最重要的是有一个空间。它在.about_img中设置:after(css文件) 我做错了什么?如何删除css中的空间?
下面的代码:
.clearfix:before,
.clearfix:after {
content: " ";
display: table;
}
.clearfix:after {
clear: both;
}
.left {
float: left;
}
.right {
float: right;
}
h5.title {
margin-bottom: 10px;
font: 18px/18px Arial, sans-serif;
font-weight: bold;
color: #222222;
}
#about{
text-align: center;
}
.about-wrap{
margin-left: 16%;
margin-top: 70px;
}
.about_text{
width: 30%;
text-align: right;
}
.about_right{
text-align: left;
float: right;
}
.about_img{
width: 20%;
}
.about_img:after{
content: '';
display: block;
margin: 0 auto;
height: 94px;
width: 3px;
background: #f1f1f1;
}
.about_img img{
display: inline-block;
width: 170px;
height: 170px;
border: 7px solid #f1f1f1;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
-o-border-radius: 50%;
border-radius: 50%;
}
.move_left_p{
margin-right: 20%;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>PSD to HTML</title>
<link type="text/css" rel="stylesheet" href="css/reset.css"/>
<link type="text/css" rel="stylesheet" href="css/index.css"/>
</head>
<body>
<div id="wrapper">
<div id="about" name="about" class="box">
<div class="about-wrap">
<div class="about_item clearfix">
<div class="about_text left">
<h5 class="title"><span>July 2010</span> <br/>Our Humble Beginnings</h5>
<p>Proin iaculis purus consequat sem cure
digni ssim.
</p>
</div>
<div class="about_img left">
<img src="img/about_item1.png" alt=""/>
</div>
</div>
<div class="about_item clearfix move_left">
<div class="about_text right about_right move_left_p">
<h5 class="title"><span>January 2011</span><br/>
Facing Startup Battles</h5>
<p>Proin iaculis purus consequat sem cure
digni ssim.</p>
</div>
<div class="about_img right">
<img src="img/about_item2.png" alt=""/>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
非常感谢!它有帮助 – atanyday