YAFLogo

Steve4
  • Steve4
  • 81.2% (Honored)
  • YAF Lover Topic Starter
10 years ago
I searched for this subject and saw a post that recomended using the CSS max-width and max-height properties to keep an image from being too large. I did that and it worked, but the box containing the text in the message with the image runs off the side of the page. This tells me that the box adjusts to the size of the full image and when CSS adjusts the width of the image it doesn't adjust the message container. Can you suggest a solution?

Sponsor

tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 3.0.3
10 years ago
I tried it with latest yaf 1.96

.yafnet .postdiv img {max-width:500px;max-height:100%;}

But i am not sure if it behave the same way in 1.9.5.5 or yaf 1.96 beta 1

Steve4
  • Steve4
  • 81.2% (Honored)
  • YAF Lover Topic Starter
10 years ago
I tried it and it doesn't seem to work for me. The image still resizes, but postdiv does not. I think I may have 1.9.5.5. Thanks anyway.

Steve

squirrel
10 years ago
Originally Posted by: Steve4 

I tried it and it doesn't seem to work for me. The image still resizes, but postdiv does not. I think I may have 1.9.5.5. Thanks anyway.

Steve

You might try applying the max-width rule to the postdiv itself without the img element in it.

.yafnet .postdiv {max-width: 90%;}
or something along those lines. Depending on how you set your overall page width - a little experimentation will be needed here. Your catching the image width, but that may be applied AFTER the image is loaded with the browser, whereas the div itself is seeing the original size.
If you can't find it using the forum search, try my signature link -- searches this site using Google: Google is my Friend 
Steve4
  • Steve4
  • 81.2% (Honored)
  • YAF Lover Topic Starter
10 years ago
squirrel

Thanks for the tip. That solved much of the problem. There is still a problem with the table of the post with the large image, but the div containing the text resizes. The problem is that there are many tags inside tags and they all have classes and there may be some formatting going on in classes that I haven't found, I'm not sure. I may keep digging to find the last hangup, but it looks much better now.

Thanks again

Steve