0

How to center only .arrow while keeping .description as it is?

<div class="container">
    <div class="description"></div>
     <div class="arrow"></div>
</div>

.container{
    display: 'flex',
    'flex-direction': 'column'
}
Michael Benjamin
  • 346,931
  • 104
  • 581
  • 701

2 Answers2

1
.arrow {
   position: absolute;
   left: 50%;
   top: 50%;
   transform: translate(-50%,-50%);
}

.container {
    position: relative;
}

Explanation: https://stackoverflow.com/a/36817384/3597276

Michael Benjamin
  • 346,931
  • 104
  • 581
  • 701
-2

Add

.arrow {
    width: 50%;
    margin: 0 auto;
}
Vojtone
  • 137
  • 5