I’m new to CSS and HTML. I made 3 boxes next to each other and I want to have 2 more rows of 3 boxes per row. I can’t seem to understand how to separate the rows. They always end up on the same row, distorted and I’ve been trying all morning to fix it. I will appreciate your help, thank you!
.container {
display: flex;
justify-content: space-between;
}
.box {
width: 400px;
height: 240px;
background-color: #ccc;
margin: 10px;
transition: all 0.3s ease-in-out;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
overflow: hidden;
text-align: justify;
position: relative;
}
.box:hover {
transform: scale(1.1);
}
.box .content {
font-size: 10px;
padding: 20px;
color: #fff;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
}
.box .title {
font-size: 14px;
font-weight: bold;
margin-bottom: 10px;
position: justify;
top: 50%;
left: 50%;
}
.box:nth-child(1) {
background-color: #fec10d;
}
.box:nth-child(2) {
background-color: #0077c0;
}
.box:nth-child(3) {
background-color: #b2d234;
}
.box img {
position: relative;
top: 1%;
left: 50%;
transform: translateX(-175%);
height: 80px;
width: 80px;
object-fit: contain;
margin-bottom: 5px;
padding-bottom: 5px;
margin: auto;
display: block;
}
<div class="container">
<div class="box">
<div class="content">
<img src="https://printeconline.sharepoint.com/:i:/r/sites/Marketing/Group%20Marketing%20Folder/Brand/Brand%20Materials/Values/Icons/Icons/Printec_Values_Icons_White_500x500px/Printec_Care_Icon_White_500x500px.png?csf=1&web=1&e=paSbKD" alt="Care">
<div class="title">TEAMWORK</div>
<div>Actively seeks opportunities to collaborate with and support others. Builds relationships across the organization, shares knowledge and experience, involve others and communicates effectively.</div>
</div>
</div>
<div class="box">
<div class="content">
<img src="https://printeconline.sharepoint.com/:i:/r/sites/Marketing/Group%20Marketing%20Folder/Brand/Brand%20Materials/Values/Icons/Icons/Printec_Values_Icons_White_500x500px/Printec_Care_Icon_White_500x500px.png?csf=1&web=1&e=paSbKD" alt="Care">
<div class="title">BUILDS TRUST</div>
<div>Gains the trust of others through honesty and authenticity. Shows consistency between his/her words and actions, upholds professional codes of conduct, acts in accordance with the company’s policies, delivers on promises, and takes personal responsibility
for decisions, actions, and mistakes.</div>
</div>
</div>
<div class="box">
<div class="content">
<img src="https://printeconline.sharepoint.com/:i:/r/sites/Marketing/Group%20Marketing%20Folder/Brand/Brand%20Materials/Values/Icons/Icons/Printec_Values_Icons_White_500x500px/Printec_Care_Icon_White_500x500px.png?csf=1&web=1&e=paSbKD" alt="Care">
<div class="title">CARE FOR OTHERS AND INCLUSION</div>
<div>Actively seeks opportunities to collaborate with and support others. Builds relationships across the organization, shares knowledge and experience, involve others and communicates effectively.</div>
</div>
</div>
</div>
2
Answers
Apply these changes to resolve this issue :
Please use the below code.
below code: