我的容器步骤第一行,但是当浮动导致第二行开始时,第二行不会步骤。我怎样才能防止踩踏?
HTML
echo "<div class='img-container'><div class='circular--portrait'><img src=\"" . $row["IMG_URL"]. "\" /></div><br><div class='caption'><h1>". $row["FirstName"]. "</h1><p>" . $day_month ."</p></div></div><br>";
CSS
.img-container{
width: 200px;
margin:1em;
display:inline;
float:left;
}
.circular--portrait {
width: 200px;
height: 200px;
overflow: hidden;
border-radius: 50%;
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
-webkit-border-radius: 99em;
-moz-border-radius: 99em;
border-radius: 99em;
border: 5px solid #eee;
box-shadow: 0 3px 2px rgba(0, 0, 0, 0.3);
}
.circular--portrait img {
width: 100%;
height: auto;
margin-top: -25px;
}