Thursday, December 16, 2021

Image Overlay Title

 Image Overlay Title


 <!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>Image Overlay Title</h1>

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

    <div class="container">

    <img src="man.png">

     <div class="Overlay">My Name John</div>

    </div>

</body>


</html>


CSS Image Overlay Title Style

 .container{

  position: relative;

  width:50%;

  max-width:300px;

}

img{

  display: block;

  width:100%;

  height:auto ;

}

.Overlay{

  position: absolute;

  bottom:0px;

  background-color:rgba(0,0,0,0) ;

  background-color:rgba(0,0,0,0.5) ;

  color: #f1f1f1;

  width:100%;

  transition:.5s ease;

  color: white;

  opacity:0;

  font-size:20px;

  padding:20px;

  text-align: center;

}

.container:hover .Overlay{

  opacity:1;

}

No comments:

Post a Comment

JavaScript Animated

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