Skip to content Skip to sidebar Skip to footer

Changing Images On Hover

I am trying to change images on hover,i put the default image at size 108x100 and the image that was suppose to change into on hover is at size 161x143 but when i hover image does

Solution 1:

The problem is that the .img responsive class is shrinking your layout to keep it responsive. You can override it , though, but I'm not sure you'll like the result much:

CSS

.img-responsive {

        max-width: 90%;

    }

    .img-responsive:hover {

        max-width: 100%;

    }


       .well {

max-height: 60px;
   }

Here is a DEMO

I suggest you start out again, maybe use more fixed values of your container navbar so that it won't move. Also, the respnsiveness forces the images to be quite less than their actual size and on some displays people will most likely be unable to recognize what's depicted on the image.

Solution 2:

You are using the .img-responsive class on your images, which means they will take up 100% of the space available (up to their own max. width). So if the available space is 100px, your original image is 120px natively, it will take up 100px. When you then change its src to another, bigger image, it will still just take up 100px.

Post a Comment for "Changing Images On Hover"