Take the 2-minute tour ×

hey guys, somehow i can't find the solution for my little problem. i have a paragraph setting with a max-width of 630px. in some cases i have images within one of those paragraphs - and in this case i want the image to act normal -> without any max-width setting.

.post-body p {
    max-width: 630px;
.post-body p img{
    max-width:100% !important;

is it even possible to have the image larger than the max-width setting that's set to it's parent? do i need to use javascript (jquery)?

thank you for your help.

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

Unless you're modifying the image width some other way, as long as you don't do anything to the image it will display at full size.

See here: http://jsfiddle.net/WrfQQ/

I didn't bother declaring any CSS for the image, so it, by default, will show up at full size. (Please note, for the sake of testing I decreased the width of the p to 100px)

share|improve this answer
oh, thank you-so true. i had it set as object! weird. thank you anyway! –  matt Nov 9 '10 at 20:28
add comment

As I can see the problem is that you put a MAX-width to the img... you have to code the relative width... so:

.post-body p img{
position: relative;
width: 100%;

if you want it in jQuery the code is the below:

$('.post-body p img').width() == $('.post-body p').width();
share|improve this answer
add comment

Your Answer


