我有两个div在此刻包含不同的图像和文字。他们使用相同的css样式.cheese_people
我需要在两个框的中间创建一个边距。我将如何做到这一点?如何在两个独立的div之间创建保证金?
也我真的需要两个div来做到这一点?我这样做的唯一原因是让他们在同一个网格线上。
<div class=" grid 6 cheese_people">
<img class="people_photo" src="img/cheese_expert.jpg">
<h4>Chief Cheese Taster <br> Dave Le Conk</h4>
<p class="chesse_people">I've always had a passion for cheese - Now I get to taste it everyday!</p>
</div>
<div class=" grid 6 cheese_people">
<img class="people_photo" src="img/cheese_owner.jpg">
<h4>The Big Cheese Owner <br> Sally De Cheese</h4>
<p class="chesse_people">I wanted to create an online store that I'd would trust</p>
</div>
.cheese_people {
font-family: sans-serif;
background-color: #dec38c;
border:solid 3px #6b5221;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
float:left;
width:45%;
}
您是否尝试添加'margin-right:10px;'例如? – kunalbhat
您可以添加“margin-right”并将其从“最后一个孩子”中移除。 – Brewal
P.S.您不再需要为border-radius定义浏览器前缀:http://caniuse.com/#search=border-radius – kunalbhat