#1
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?
Topic Starter
  • Steve4
  • Rank: YAF Lover
  • Reputation:
    Honored
    81.2%
  • Joined: 12/12/2011
  • Posts: 47
  • Thanks: 3 times
#2
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
  • tha_watcha
  • Rank: YAF.NET Project Lead
  • Reputation:
    Exalted
    100%
  • Medals:
    Medal of Honor: Portal Puzzle Master: Portal Puzzle Master for DNNMedal of Honor Key: Given to pillars of the community who are key players in the YAF community and project.DNN Master: DNN Module ManBug Killer Medal of Honor: Medal for being a kick-ass bug killer!Medal of Honor for the Support King: Support King! Amazing asset to the YAF.NET Community.
  • Joined: 06/03/2010
  • Posts: 4,003
  •  Germany
  • Thanks: 73 times
  • Was thanked: 1203 time(s) in 1029 post(s)
#3
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
Topic Starter
  • Steve4
  • Rank: YAF Lover
  • Reputation:
    Honored
    81.2%
  • Joined: 12/12/2011
  • Posts: 47
  • Thanks: 3 times
#4
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 
  • squirrel
  • Rank: YAF Leader
  • Reputation:
    Exalted
    100%
  • Medals:
    YAF.NET Supporter: Loves YAF.NET!YAF.NET Supporter: Supports the YAF.NET project with a contribution.YAF.NET Purple Supporter: Purple heart for being an Asset to the YAF.NET Community.YAF.NET Supporter: Supports our efforts. Thank you.Medal of Honor for the Support King: A huge help to the YAF.NET community!
  • Joined: 14/01/2010
  • Posts: 925
  • Thanks: 249 times
  • Was thanked: 169 time(s) in 160 post(s)
#5
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
Topic Starter
  • Steve4
  • Rank: YAF Lover
  • Reputation:
    Honored
    81.2%
  • Joined: 12/12/2011
  • Posts: 47
  • Thanks: 3 times
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