The aim is to have the grey images overlayed by the blue when hovered over (so that the grey image becomes the blue image).
At the moment the blue images are off centre and therefore not directly on top of the grey.
Here's how the menu currently looks when I hover over the first icon.
HTML
<div class="footerContainer">
<div class="iconContainer">
<img class="homeIcon" src="images/Home Icon.png"/> <!--grey image-->
<img class="homeIconHover" src="images/Home Icon blue.png"/> <!--blue image-->
</div>
<div class="iconContainer">
<img class="magIcon" src="images/Magazine Icon.png"/>
<img class="magIconHover" src="images/Magazine Icon blue.png"/>
</div>
<div class="iconContainer">
<img class="newsIcon" src="images/News Icon.png"/>
<img class="newsIconHover" src="images/News Icon blue.png"/>
</div>
<div class="iconContainer">
<img class="eventIcon" src="images/Event Icon.png"/>
<img class="eventIconHover" src="images/Event Icon blue.png"/>
</div>
<div class="iconContainer">
<img class="socialIcon" src="images/Social Icon.png"/>
<img class="socialIconHover" src="images/Social Icon blue.png"/>
</div>
</div>
CSS
.footerContainer{
border-top: rgba(0,0,0,0.8) 2px solid;
height: 5rem;
display: flex;
background-color: #e5e5e5;
background-size: cover;
margin: 0;
padding: 0;
text-align: center;
position: relative;
}
.iconContainer{
width: 20%;
margin: auto;
}
/* grey images */
.homeIcon{
text-align: center;
height: 71px;
margin: auto;
position: relative;
}
.magIcon{
text-align: center;
height: 58px;
margin: auto;
position: relative;
}
.newsIcon{
text-align: center;
height: 64px;
margin: auto;
position: relative;
}
.eventIcon{
text-align: center;
height: 80px;
margin: auto;
position: relative;
}
.socialIcon{
text-align: center;
height: 80px;
margin: auto;
position: relative;
}
/* HOVER */
/* blue images */
.homeIconHover{
text-align: center;
height: 71px;
margin: auto;
opacity: 0;
position: absolute;
}
.iconContainer:hover .homeIconHover{
opacity: 1;
}
.iconContainer:hover .homeIcon{
opacity: 0;
}
.magIconHover{
text-align: center;
height: 58px;
margin: auto;
opacity: 0;
position: absolute;
}
.iconContainer:hover .magIconHover{
opacity: 1;
}
.iconContainer:hover .magIcon{
opacity: 0;
}
.newsIconHover{
text-align: center;
height: 64px;
margin: auto;
opacity: 0;
position: absolute;
}
.iconContainer:hover .newsIconHover{
opacity: 1;
}
.iconContainer:hover .newsIcon{
opacity: 0;
}
.eventIconHover{
text-align: center;
height: 80px;
margin: auto;
opacity: 0;
position: absolute;
}
.iconContainer:hover .eventIconHover{
opacity: 1;
}
.iconContainer:hover .eventIcon{
opacity: 0;
}
.socialIconHover{
text-align: center;
height: 80px;
margin: auto;
opacity: 0;
position: absolute;
}
.iconContainer:hover .socialIconHover{
opacity: 1;
}
.iconContainer:hover .socialIcon{
opacity: 0;
}
Cheers in advance