Rishi Jogle
Rishi Jogle

Reputation: 287

How to show image at half or crop it's own size?

I have tried with many times but didnt happen ..

on img src i want to show only half image and when i will mouseover on that image it will show me the full image ... is it possible

Upvotes: 7

Views: 14777

Answers (3)

sandeep
sandeep

Reputation: 92803

There is a property called clip

Check out this fiddle

Upvotes: 10

Alex
Alex

Reputation: 6406

Yes. You could use a div with overflow:hidden; around the image. Change the size of the div instead the size of the image.

Example with jQuery: http://jsfiddle.net/5GWCz/

Or CSS-Only: http://jsfiddle.net/5GWCz/2/

Upvotes: 4

user554672
user554672

Reputation: 124

you can use CSS Image Sprites for doing this look in this link

http://www.w3schools.com/css/css_image_sprites.asp

Upvotes: 0

Related Questions