Show Caption on Hover image using pure Css | Sanwebcorner

Show Caption on Hover image using pure Css

This example helps you to show the image caption and contents on hover the particular image. When hover this image it displays caption and description when you mouse out it will hide. This concept is fully done by using pure css, This is very simple and useful for your website. In website some of the places you should implement this kind of images with caption for example people page, gallery page, etc... Here i will provide full source code and demo page, Check out this demo page how it was. 

show-image-caption-on-hover-image




Html code for Show caption on hover:

<h1>Display caption on hover the image with animated fade</h1>
<p>Simply follow this css and html you can able to do this hover effect. this is very useful to people page and other page in your website.</p>
<ul class="san-style">
<li>
<img src="img/caption-hover-image-1.jpg" alt="">
<div class="caption">
<div class="blur"></div>
<div class="caption-text">
<h1>Hover Caption Heading</h1>
<p>Hover caption content</p>
</div>
</div>
</li>
<li>
<img src="img/caption-hover-image-2.jpg" alt="">
<div class="caption">
<div class="blur"></div>
<div class="caption-text">
<h1>Hover Caption Heading</h1>
<p>Hover caption content</p>
</div>
</div>
</li>
<li>
<img src="img/caption-hover-image-3.jpg" alt="">
<div class="caption">
<div class="blur"></div>
<div class="caption-text">
<h1>Hover Caption Heading</h1>
<p>Hover caption content</p>
</div>
</div>
</li>
<li>
<img src="img/caption-hover-image-4.jpg" alt="">
<div class="caption">
<div class="blur"></div>
<div class="caption-text">
<h1>Hover Caption Heading</h1>
<p>Hover caption content</p>
</div>
</div>
</li>
<li>
<img src="img/caption-hover-image-2.jpg" alt="">
<div class="caption">
<div class="blur"></div>
<div class="caption-text">
<h1>Hover Caption Heading</h1>
<p>Hover caption content</p>
</div>
</div>
</li>
<li>
<img src="img/caption-hover-image-1.jpg" alt="">
<div class="caption">
<div class="blur"></div>
<div class="caption-text">
<h1>Hover Caption Heading</h1>
<p>Hover caption content</p>
</div>
</div>
</li>
</ul>

Css code for on hover effect:

body{
font-family: "Lato";
background-color: #fff;
padding:20px 30px;
margin: 0px;
}

h1,h2,h3,h4{
padding: 0px;
margin: 0px;
}
.san-style{
list-style-type: none;
margin: 0px;
padding: 0px;
}
.san-style li{
float: left;
padding: 0px;
position: relative;
overflow: hidden;
}

.san-style li:hover .caption{
opacity: 1;
transform: translateY(-100px);
-webkit-transform:translateY(-100px);
-moz-transform:translateY(-100px);
-ms-transform:translateY(-100px);
-o-transform:translateY(-100px);
margin: 2px;
}
.san-style img{
margin: 2px;
padding: 0px;
float: left;
z-index: 4;
width:400px;
height:300px;
}
.san-style .caption{
cursor: pointer;
position: absolute;
opacity: 0;
top:300px;
-webkit-transition:all 0.15s ease-in-out;
-moz-transition:all 0.15s ease-in-out;
-o-transition:all 0.15s ease-in-out;
-ms-transition:all 0.15s ease-in-out;
transition:all 0.15s ease-in-out;

}
.san-style .blur{
background-color: rgba(0,0,0,0.7);
height: 300px;
width: 400px;
z-index: 5;
position: absolute;
}

.san-style .caption-text h1{
text-transform: uppercase;
font-size: 18px;
}
.san-style .caption-text{
z-index: 10;
color: #fff;
position: absolute;
width: 400px;
height: 300px;
text-align: center;
top:20px;
}

Post a Comment

Labels

360 degree view product image 3d rotate 3d text 3step-form Accordion menu ajax All Browsers Animated Background Gradient animation audio controller auto complete Best accordion menu bootstrap border bounce effect on hover Breadcrumb calculate age by dob calendar Captcha change image on mouse move color chooser countdown Counter on scroll create random number Css css animation css buttons css hover css3 customized upload Button Date picker delete data from table Different scroll speed email otp verification email verifier Embed eventlist Expanding Menu feedbck form flash news section close button full screen menu Google custom search Google Maps Google reCAPTCHA Google site search gradient hide menu Horizontal News ticker Hover Htm Html html dropdown html form html5 html5 form validation Iframe image hover increment decrement textbox value based on select box Javascript Jquery js Layered image effect on mouse hover lock & unlock page scroll marquee marquee with close button mobile number validation mobile otp login Multi-level-drop-down-menu multi-level-form Multi-Step-form mysql News ticker on hover change text to image our team page password generator password strength checker Photoshop PHP populate html selectbox Popup image on click the link pure css Question type form random number generate Random password Redirect page Based on the select box while submit the form responsive responsive menu responsive popup box Responsive Vertical Time line design rotate image selectbox based on select box simple coming soon page simple countdown based on end date simple typing effect slider sliding tab sms otp login statistic counter on scroll switch tag shape team member Time picker toggle toggle view transparent button underline animation up down slide validation vertical fixed sidebar Webtips Youtube