Image hover with text Overlay Effect ( Source Code ) HTML Image Hover Overlay Palm Beach Florida McWay FallsCalifornia Blue Beach Puerto Rico CSS body{ background: #262626; } h2 { text-align: center; color: #fff; font-size: 50px; font-family:Audiowide; } .img-area{ width: 1170px; margin: 2% auto; } .single-img { position: relative; width: 30%; float: left; margin: 0 1%; } .image { display: block; width: 100%; height: auto; } .img-overlay { position: absolute; bottom: 0; left: 0; right: 0; background-color: #144775; overflow: hidden; width: 100%; height: 0; transition: .5s ease; } .single-img:hover .img-overlay { height: 100%; } .text { position: absolute; top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%); -ms-transform: translate(-50%, -50%); transform: translate(-50%, -50%); color: #fff; text-align: center; font-size: 20px; font-family: poppins; text-transform: uppercase; letter-spacing: 2px; font-weight: bold; } .text span{ font-weight: 300; }
No comments