Gagan Bansal

Gagan Bansal

  • NA
  • 682
  • 244.1k

Resize background image of div tag in css

Nov 18 2011 6:18 AM
Hi,

i want to show a image as a background of div tag
for exp... 
<div style="height:200px;width:200px;background-image:url (img.jpg)">
</div>

but the problem is that image's height is 500px and width is 600px...
and bcaz of this image is not completely visible in div tag... only some part of it is visible
but i want full image in div tag...

if image is small then we can use background-repeat property but in this reverse case how can i solve my problem... (i dont want to change the actual size of image.. )

if someone knw pls pls reply me... it would be very helpful
Thanks in advance

Answers (4)