I am trying to make this design
and I already have except for the IMAGE on each div.
How can I position the images on that position?
I am using this code
.image {
position:absolute;
width:100px;
top:33%
}
but my problem is on responsive, it does not stay on that position. This is my code that I have.
body {
margin: 0;
background-color: darkgray
}
#main {
background: black url("https://source.unsplash.com/random/1000x400") no-repeat center center /cover;
overflow: hidden;
margin-left: -1px;
}
#main > * {
width: calc((100% / 4) - 1px);
height: calc((100vw / 4) - 1px);
float: left;
border: 1px solid white;
display: flex;
align-items: center;
justify-content: center;
margin: -1px -1px 0 0;
float: left;
color: white;
background-color: rgba(255,255,255,0);
transition: background-color .4s cubic-bezier(.4,0,.2,1);
}
#main > *:hover {
background-color: rgba(255,255,255,.35);
cursor: pointer;
}
#main > *:first-child {
height: calc((100vw / 2) - 1px);
}
body {
margin: 0;
}
@media (max-width: 539px) {
#main>* {
width: calc((100% / 2) - 1px);
height: calc((100vw / 2) - 1px);
}
#main>*:first-child {
height: calc(100vw - 1px);
}
}
.icon {
position:absolute;
width:100px;
top:33%
}
<div id="main">
<div>
<img class="icon" src ="http://via.placeholder.com/350x150">
Excellence
</div>
<div> <img class="icon" src ="http://via.placeholder.com/350x150">
Quality </div>
<div> <img class="icon" src ="http://via.placeholder.com/350x150">Efficiency </div>
<div> <img class="icon" src ="http://via.placeholder.com/350x150">Creativity </div>
<div> <img class="icon" src ="http://via.placeholder.com/350x150">Faith </div>
<div> <img class="icon" src ="http://via.placeholder.com/350x150">Effectiveness </div>
<div> <img class="icon" src ="http://via.placeholder.com/350x150">Teamwork </div>
</div>