如何在保持.description
原样的同时只居中.arrow
?
<div class="container">
<div class="description"></div>
<div class="arrow"></div>
</div>
.container{
display: 'flex',
'flex-direction': 'column'
}
.arrow {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
}
.container {
position: relative;
}
说明:https://stackoverflow.com/a/36817384/3597276
添加
.arrow {
width: 50%;
margin: 0 auto;
}