Saturday, December 18, 2021

Fade in Overlay icon with Cards

 Fade in Overlay icon with Cards


<!DOCTYPE html>

<html>


<head>

    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link rel="STYLESHEET" type="text/css" href="web.css">

    <title>web design</title>

</head>


<body>

<h1>Fade in Overlay icon</h1>

<p>Hover over the image to see the effect.

</p>

<div class="container">

    <img src="man.png">

    <div class="overlay">

        <a href="#" class="icon">

            <i class="fa fa-user"></i>

        </a>

    </div>

</div>

</body>


</html>


 CSS Fade in Overlay icon with Cards STYLE

.container{

  position: relative;

  width:100%;

  max-width:400px;

}

img{

  display: block;

  width:100%;

  height: auto;

}

.overlay{

  position: absolute;

  bottom:0px;

  top:0px;

  left:0px;

  right:0px;

  height:100%;

  width:100%;

  opacity:0;

  transition:.3s ease;

  background-color: red;

}

.container:hover .overlay{

  opacity:1;

}

.icon{

  color:white;

  font-size:100px;

  position: absolute;

  top:50%;

  left:50%;

  transform: translate(-50%, -50%);

  -webkit-transform: translate(-50%, -50%);

  text-align: center;

}

.fa-user:hover{

  color: #eee;

}


No comments:

Post a Comment

JavaScript Animated

  JavaScript Animated <!DOCTYPE html> <html> <style> #myContainer {   width: 400px;   height: 400px;   position: relative;...