Steffan Donal
Steffan Donal

Reputation: 2334

Changing the size of an img container without changing the image size?

Here's an example of my markup:

<li class="tumblr_post tumblr_photo_post">
    <img class="tumblr_photo" alt="Testing photo post" src="http://29.media.tumblr.com/tumblr_li5e4zfgrd1qi4tmio1_400.png">
    <div class="tumblr_caption">
        <p>Testing photo post</p>
    </div>
</li>

I'd like to change the size of the image's container without changing the image's size. As it's directly in the flow as an img, how can I do this?

Upvotes: 0

Views: 1098

Answers (1)

moleculezz
moleculezz

Reputation: 7703

I think your image is not contained into a div container like you are doing with the video on top.

Try to use the following jQuery code to add the img into a div container. You will have to add the jQuery library to your page of course.

$('.tumblr_photo').wrap('<div class="somename" />');

Upvotes: 1

Related Questions