I have four divs sitting inside a parent flexbox.
What is confusing me is how I can get the images within the flex items to center vertically and horizontally. I thought the following would do it:
justify-content: center;
align-items: center;
Adding these to the flexbox parent would work but it doesnt seem to have the effect I am looking for.
My CSS is as follows:
.flex-container {
display: flex;
flex-wrap: nowrap;
width: 650px;
}
.flex-container > div {
width: 100px;
margin: 10px;
text-align: center;
line-height: 75px;
font-size: 30px;
align-items: center;
justify-content: center;
}
.div-1 {
flex: 2;
}
.div-2 {
flex: 1;
}
.div-3 {
flex: 1;
}
.div-4 {
flex: 1;
}
.img {
height: 55px;
}
.bookit_button {
background-color: #4CAF50;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
}
My HTML is as follows:
Ultimately, the goal is to end up with this:
http://thelavender.net/_fades/images/sample.png