Quantcast
Channel: Active questions tagged flexbox - Stack Overflow
Viewing all articles
Browse latest Browse all 1326

Is there a way to change the alignment of the last element in a flex-box? [duplicate]

$
0
0

So I have a container with display:flex. It contains elements which are centered justified. Is there a way to justify the last element to start? I tried align-self: start It didn't work.

.main{  border: 1px solid;  padding: 10px;  display: flex;  flex-wrap: wrap;  justify-content: center;}.child{  width: 90px;  border: 1px solid;}.child:last-child{  align-self: flex-start;}
<div class="main"><div class="child">    1</div><div class="child">    1</div><div class="child">    1</div><div class="child">    1</div><div class="child">    1</div><div class="child">    1</div><div class="child">    1</div></div>

Viewing all articles
Browse latest Browse all 1326

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>