:hover effect over an image in list
-
hi, i′m making image gallery. I have placed images inside unordered list. I set padding around images and than I tried to create hover effect only throught image (without padding) so i′ve used the calc() function. here is website
https://rpz.startupweb.sk/vyrobky/
but how you can see hover effect doesn′t cover whole image. Whole image have black overlay but on some edges you can see white line. Could you help me and write what′s wrong or write right procedure. Thanks a lot
CODE FOR UNORDERED LIST:
ul.thumbnail {
position: relative;
list-style: none;
margin: 0 auto;
padding: 0;
}ul.thumbnail li {
position: relative;
display: inline-block;
width: 23.5%;
cursor: pointer;
/*padding-right: 10px;*/
}ul.thumbnail li img {
position: relative;
max-width: 100%;
padding: 1.875em;
}CODE FOR HOVER EFFECT:
.parent {
width: calc(100% – 3.75em);
height: calc(100% – 3.75em);
position: absolute;
top: 50%;
left: 50%;
display: block;
background-color: black;
opacity: 0;
transform: translate(-50%, -50%);
text-align: center;
transition: opacity 500ms;
-webkit-transition: opacity 500ms;
-moz-transition: opacity 500ms;
-o-transition: opacity 500ms;
}span.parent span {
display: inline-block;
position: relative;
top: 25%;
}ul.thumbnail li:hover span.parent{
opacity: 0.7;
}.parent-icon {
padding: 25px;
}
- The topic ‘:hover effect over an image in list’ is closed to new replies.