flex - align last item to right

Viewed 3448
  1. How can I stretch the last item to the right, and align the filter icon to right end of the page?

    the grey background need to stretch to right

  2. How can I center align the icons vertically in flex?

    align-items:center; causing the height of the li to collapse.

body{
  background: url(http://i.imgur.com/ilgJJ1Q.gif);
  margin: 0;
}
ul{
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  height: 80px;
}
li{
  padding: 10px;
  text-align: center;
  min-width: 80px;
}
li:last-child{
  background: rgba(38, 46, 54, .6);
}
.c2{ background: #a15796; }
.c3{ background: #b48c4d; }
.c4{ background: #3a7d7d; }
<ul>
  <li class="c1"><img src="http://i.imgur.com/SRVh4os.png" alt=""></li>
  <li class="c2"><img src="http://i.imgur.com/rBM2CYr.png" alt=""></li>
  <li class="c3"><img src="http://i.imgur.com/9dFFuH5.png" alt=""></li>
  <li class="c4"><img src="http://i.imgur.com/7bQ73kd.png" alt=""></li>
  <li class="c1"><img src="http://i.imgur.com/yJ4vKBG.png" alt=""></li>
</ul>

https://jsfiddle.net/afelixj/79pybrh9/

the actual page has text also with the icon

enter image description here

1 Answers
Related