Vishal Koradiya
Vishal Koradiya

Reputation: 1

how to resize image according to div tag image automatic

i want to resize my image that is inside div tag according to changing my div tags size automatically.how can i achieve using j query please help us NOTE image is inside div tag.

Upvotes: 0

Views: 202

Answers (3)

pavan
pavan

Reputation: 470

Here is the code.

    <div id="img_box">
    <img src="path/to/horizontal_image.jpg" style="width: 100%" />
    </div>

Also have a look at the link below.

http://www.webmasterworld.com/css/3828593.htm

http://www.codingforums.com/showthread.php?t=145288

Upvotes: 1

Jai
Jai

Reputation: 74738

with jQuery:

$('.divSelector').find('img').css({
  'width': '100%',
  'height': '100%'
});

Upvotes: 0

timofeiMih
timofeiMih

Reputation: 109

The answer is simple add width: 100% to style. Like so:

<img src='image_url.jpg' style='width: 100%' alt='image_name'/>

Upvotes: 2

Related Questions