Hostgator coupons for up to 99% off hosting for Dynamic Drive visitors!
Advanced Search Usage Terms Submit Contact
Dynamic Drive CSS Library

CSS Library: Image CSS: Here

CSS Popup Image Viewer

Author: Dynamic Drive

Enable arbitrary links or image thumbnails to pop up an enlarged (different) image onMouseover by using this CSS code. With the help of CSS's ":hover" pseudo class, combined with relative and absolute positioning, the enlarged images are simply included on the page as normal HTML, "popping" up on demand. CSS is behaving more and more like scripting!


One of my favorite foods is sushi
Doesn't this look good?
, and it's good for you too! Coffee and sushi probably don't mix well, but I like some Zoka Coffee
Zoka Coffee
to boot! Here are some thumbnails from my trip to La la land:

Simply beautiful.

So real, it's unreal. Or is it?

The CSS:


Code Info

Rate this code:

Date Posted: 05/07/2006

Revision History: None

Usage Terms: Click here

Your Comments (523)

Got a question or need help customizing this CSS code? Post it in the CSS Forums. If you have a comment or suggestion instead, post it in the comments section below.

Comment Pages 4 of 53 pages « First  <  2 3 4 5 6 >  Last »

I have blended this script whith the Dom drag&Drop; found at - and the images are now draggable - the working page is online at

Unfortunately, the area under the images is fixed, and I have not found a way to make it draggable with the image: if only anyone could solve this!
Posted by virgix on 06/14, 04:39 PM
How can we show the picture on the horizontaly and verticaly middle of the page?

Currently, the position of the picture depends of the position of the thumb.
I'm designing an online help and I would it appears everytime in the middle of the page.

Posted by Max on 06/15, 02:28 AM
Great script, very easy to use.

My only question is - are all browsers able to use this? ((Sorry if I missed this somewhere!))
Posted by Wendy Kerr on 06/15, 12:31 PM
It`s very very good!
Posted by abc on 06/16, 10:18 AM
It's wonderful, of course. One problem though. I'm trying to use this in combination with overflow : scroll and it's fine in MSIE but in Firefox the large image disappears as soon as the mouse touches the scrollbar (which rather defeats my purpose). Any help?
Posted by Chuck Cavanaugh on 06/17, 05:34 PM
could you make it so it centers on your screen becuase if you scroll down half past the image and put your mouse on it you only see half of it.
Posted by james on 06/19, 01:31 PM
Nice script don't know where I could use it as a good function but it is cool.

Posted by David Decker on 06/20, 08:17 PM
hi, what if i want to use an image from someone else's website, so instead of a link "sushi.jpg", it will be something like ""

is that possible?
Posted by jack on 06/24, 06:53 PM
hey guys, is there any way i can link the picture or even the text to a webpage? i would really like to do that, when the cursor goes over the text, the popup image appears and i can click on the text or image to go to a new webpage ...

thanx a ghazillion!!!!!!
Posted by john on 06/24, 08:27 PM
it seems that this css code renders funny safari as if there are layering problems as part of the image appears to be hidden by text which is actually below it. could it be a z-index problem. the whole thing works on ie and firefox
Posted by africanshox on 06/29, 10:31 AM

Comment Pages 4 of 53 pages « First  <  2 3 4 5 6 >  Last »

Commenting is not available in this weblog entry.
Copyright 2006-2015 Dynamic Drive Read our Usage Terms before using any of the CSS codes.