Sunil
Sunil

Reputation: 165

image in a <p> tag that is inside a div is coming larger than the div size

Hi There is problem that i am facing in only in one post of the wordpress.The image that is inside a

tag in tag is coming bigger than the actual size of the div. because of this user is not able to differentiate between to different post.please check the image enter image description here

here is the link where you can check.

Link

Upvotes: 1

Views: 189

Answers (3)

What have you tried
What have you tried

Reputation: 11148

You can add a float: left to the content, like below:

.entry-content, .entry-summary {
margin: 1.5em 0 0 0;
text-align: justify;
width: 735px;
float: left;
}

This will cause the div to stretch around all of its contents :)

Upvotes: 0

imabigguest
imabigguest

Reputation: 1

you could try:

#div img{min-width:100%;height:auto}

This will keep the aspect ratio, unless ofcourse you want to cut if off with the overflow

Upvotes: 0

Billy Moat
Billy Moat

Reputation: 21050

The image is floating left so it's parent DIV ".entry-summary" needs to expand to accomodate the floating element.

To do this you need to add "overflow: hidden" to ".entry-summary".

.entry-summary {
    overflow: hidden;
}

Upvotes: 1

Related Questions