I have been trying to confine the teal hover effect within the boundaries of my social media links. Despite adjusting padding, heights, and widths using CSS properties, the hover effect still extends beyond the right border.
Here is how it appears without hovering:
https://i.sstatic.net/tnQNV.png
This is the appearance when hovering:
https://i.sstatic.net/uOBXi.png
The dimensions of each image are 19px × 15px.
#box {
width: 200px;
height: 50px;
background-clip: padding-box;
position: relative;
margin: 0;
left: 1.4em;
background: rgba(0, 0, 0, 1);
float: right;
z-index: 200;
}
#boxlist li {
height: 50px;
width: 20px;
position: relative;
list-style-type: none;
display: inline-block;
bottom: 1em;
margin-left: -2.5em;
float: left;
}
.imgli:hover {
background: rgba(0, 255, 255, 1);
}
.imgli {
border-left: 1px solid rgba(153, 153, 153, 1);
padding-right: 4em;
}
.imgli:first-child {
left: -0.1em;
border: none;
}
.imgli:nth-child(2) {
left: 1em;
}
.imgli:nth-child(3) {
left: 2em;
}
<header>
<div id="box">
<ul id="boxlist">
<li class="imgli"><img src="images/banner-social-icon-twitter.png" class="boximg"></li>
<li class="imgli"><img src="images/banner-social-icon-facebook.png" class="boximg"></li>
<li class="imgli"><img src="images/banner-social-icon-email.png" class="boximg"></li>
</ul>
</div>
</header>