Could you assist me with this issue? I have a container div that holds 7 inner divs. Currently, with the flexbox properties applied, I am getting this layout:
https://i.sstatic.net/7xxcp.png
However, what I actually want to achieve is this:
https://i.sstatic.net/3Z2YB.png
Below are some code snippets that I currently have
.Container {
text-align: center;
margin-left: 10px;
margin-right: 10px;
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-around;
align-items: center;
align-content: center;
}
.Items {
margin-bottom: 7px;
width: 80px;
height: 80px;
text-align: center;
font-size: 12px;
line-height: 10px;
border: 0px;
padding-bottom: 7px;
align-self: center;
}
<div class="Container">
<div class="Items">
<img height="40px" width="40px" src="http://img10.deviantart.net/af75/i/2014/242/1/9/kawaii_potato_by_hashtagpony-d7xbs1t.png" />
<br/>
<span>Icon 1</span>
</div>
<!-- More items here -->
</div>
UPDATE Thank you to those who responded. However, I missed out on mentioning these details:
- I want the icons to be evenly distributed, hence the need for
justify-content: space-around
- I also want the icons to be centered horizontally, which is why I used
align-items: center; align-content: center;
The dilemma now is: Can we have both requirements met simultaneously?