4
Answers

Resize background image of div tag in css

Ask a question
Gagan Bansal

Gagan Bansal

12y
12.2k
1
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)