on mouseover hover large images using css

on mouseover hover states means, where an image or background image changes when you move your mouse cursor into that area of the page. Traditionally, this change in image is handled via JavaScript. It’s fairly easy to write a small script that swaps out images on mouseover, but there are a number of disadvantages to this approach that have pushed many web developers toward using a CSS-only method of achieving this exact same effect.

In this tutorial i am explaining exactly how to implement a pure CSS image hover view large image effect.


    width: 576px;

.main_div a{
    padding:5px 5px;

.main_div a img{
    border:2px solid #000;

.main_div a span {
    padding:2px 4px;
    border:3px solid #000;

.main_div a span img{
    margin-bottom: 3px;

.main_div a:hover span {


<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>on mouseover hover large images using css - phpkida</title>


<div class="main_div">
    <a href="http://www.newstriger.com/gadgets/samsung/full-specifications-samsung-galaxy-j7-prime/" target="_blank">
        <img src="Full Specifications Samsung Galaxy J7 Prime.jpg" />
        <span><img src="Full Specifications Samsung Galaxy J7 Prime.jpg" /><br />Full Specifications Samsung Galaxy J7 Prime</span>
    <a href="http://www.newstriger.com/jaigarh-fort/" target="_blank">
        <img src="JAIGARH FORT JAIPUR RAJASTHAN.jpg" />
        <span><img src="JAIGARH FORT JAIPUR RAJASTHAN.jpg" /><br />Jaigarh Fort Jaipur Rajasthan</span>
    <a href="http://www.newstriger.com/top-10-most-expensive-movies-ever-made-bollywood-hollywood-news-hindi/" target="_blank">
        <img src="top-10-most-expensive-movies-ever-made-bollywood-hollywood-news-hindi.jpg" />
        <span><img src="top-10-most-expensive-movies-ever-made-bollywood-hollywood-news-hindi.jpg" /><br />Top 10 most expensive movies ever</span>
    <a href="http://www.newstriger.com/monsoon-palace/" target="_blank">
        <img src="mansoon-palace-udaipur.jpg" />
        <span><img src="mansoon-palace-udaipur.jpg" /><br />Mansoon Palace Udaipur</span>
    <div style="clear:both;"></div>


You Can Download Source Code of This Tutorial

If You have any question and problem in this code feel free, leave comment below! SHARE WITH YOUR FRIENDS..

Mukesh Jakhar - PHP Web Developer
Mukesh Jakhar

This is Mukesh Jakhar. I’m a professional web developer with 3+ years experience. I am always ready for freelance work and i am writing blogs in my free time. I love to learn new technologies and share with others.

I founded PHPKIDA in September 2015. The focus of this website to provide web development tutorials of PHP, WordPress, CodeIgniter, Jquery, MySQL, HMTL, CSS etc and sharing solution to problems which i already solved.

Sign up for weekly update

Milkshake is almost ready. If you're interested in testing it out, then sign up below to get exclusive access.