Forum Bugs

max-height bug?

bryan
I'm working on an application that's going to be using Prince a lot and noticed one little issue that is pretty much putting a halt on everything until I can figure out a fix. If this is indeed a bug, it'd be amazing if someone can fix it or help me find a way around it.

I have an image inside a div. The div has a set height, and the image has a max-height of 100%.

This works fine if the img is the ONLY thing inside the div. If there are any other elements inside the div, max-height isn't applied to the image. max-width still works, but max-height is apparently ignored.

Here's what I'm talking about...

HTML Source: http://resen.co/misc/prince/max-height.html (As you can see, both boxes/images are identical)

Generated PDF: http://resen.co/misc/prince/max-height.pdf (The second box has an empty <p> inside of it, and the image bleeds outside its container, even though its max-height is set to 100%)

Again, any help would be greatly, greatly appreciated. Our application is about 95% done, and unfortunately is dependent on the max-height property working in this context. I believe what I'm trying to do should validate just fine, and I've tried xhtml transitional, strict, and html5 doctypes, which all act identical.

Again, thanks for hearing me out, please let me know if there are any more test cases I can provide, and have a merry Christmas! :)
bryan
Looks like max-height is only ignored if the 2nd element in the div is set to display:block. If the empty <p> element is changed to display:inline-block, it works perfectly in my instance.