1

I have a div that is centered, and I want the margins to be preserved, as well as on the left side, but the space on the right of the last element in each row has a margin-rigth.

screenshot of my problem

I would like to remove the margin-rigth for the last elements of each row, in my actual example they are "n" divs.

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>
user5115790
  • 61
  • 1
  • 6

0 Answers0