如何从右边缘附近的最后一个元素中删除边距约束?

时间:2018-10-04 13:44:29

标签: css

我有一个居中的div,并且希望保留边距以及左边距,但是每行最后一个元素右边的空间都有 margin-rigth < / em>。

screenshot of my problem

我想删除每行最后一个元素的页边距,在我的实际示例中,它们为“ n”个div。

https://jsfiddle.net/fmu2dryw/

.container{
  display:flex;
  flex-direction:row;
  justify-content: center;
  align-items: space-between;
  flex-wrap: wrap;
  border: 1px solid red;
}

.contenedor_categorias {
  width: 100px;
  height: 50px;
  background: #dcdcdc;
  box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14), 0 1px 5px 0 rgba(0,0,0,0.12), 0 3px 1px -2px rgba(0,0,0,0.2);  
  margin-bottom: 20px;
  margin-right: 20px;
  text-align: center;
  display:flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  -webkit-transition:all 0.5s;
  -moz-transition:all 0.5s;
  -ms-transition:all 0.5s;
  -o-transition:all 0.5s;
  transition:all 0.5s;
  border-radius: 4px;
  font-size: 2rem;
}

<div class="container">
 <div class="contenedor_categorias">
  text
 </div>
 <div class="contenedor_categorias">
  text
 </div>
 .
 .
 .
</div>

0 个答案:

没有答案