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

Center one and right/left align other flexbox element

$
0
0

I would like to have AB and C aligned in the middle.

How can I get D to go completely to the right?

BEFORE:

enter image description here

AFTER:

enter image description here

ul {  padding: 0;  margin: 0;  display: flex;  flex-direction: row;  justify-content: center;  align-items: center;}li {  display: flex;  margin: 1px;  padding: 5px;  background: #aaa;}li:last-child {  background: #ddd;  /* magic to throw to the right*/}
<ul><li>A</li><li>B</li><li>C</li><li>D</li></ul>

https://jsfiddle.net/z44p7bsx/


Viewing all articles
Browse latest Browse all 1307

Trending Articles



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