can you help me here in this issue? I have this div which contains 7 divs. Currently, using the flex box, I get this output
However, what I want to happen should be like this:
Below are some codes that I roughly 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>
<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>
<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>
<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>
<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>
<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>
<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>
</div>
UPDATE Thank you for those who replied. However, I forgot to add these things.
- I want that the icons be spread out evenly that's why I need the
justify-content: space-around
- I also want that the icons be horizontally at the center that's why I used the
align-items: center; align-content: center;
The problem is this: Is it possible to have both?