Steve4
  • Posts: 47
  • Joined: 12/12/2011
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?
tha_watcha
  • Posts: 4044
  • Joined: 06/03/2010
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
UserPostedImage
Steve4
  • Posts: 47
  • Joined: 12/12/2011
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
  • Posts: 925
  • Joined: 14/01/2010
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
  • Posts: 47
  • Joined: 12/12/2011
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
Users browsing this topic
    Forum Jump  
    • You cannot post new topics in this forum.
    • You cannot reply to topics in this forum.
    • You cannot delete your posts in this forum.
    • You cannot edit your posts in this forum.
    • You cannot create polls in this forum.
    • You cannot vote in polls in this forum.

    About Us

    The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

    Powered by Resharper Donate with PayPal button

    Project Twitter Updates

    Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved