MyBB Community Forums

Full Version: Post body falling outside of container
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi guys

I'm brand new to MyBB and relatively new to forum software in general so this may well be a noobie question.

Using the default theme & latest 1.6.10 version of MyBB

I'm having a problem where when I place an image inside a post, the image isn't automatically resizing when I adjust the browser window.

Because of this, not only does the image remain it's original size but it also forces the post content to overflow outside of the container.

*Please see image below* (I've highlighted Body & Container in the pic)
[Image: post%20body%20issue.png]

I've tried to edit the img section in the Global.css and set max-width: 100%; which fixes the image resizing in realtime prefectly and stops the post body overflow.

The problem is that when I set max-width: 100%, my Avatars only show as 1px wide.

I wonder if anyone could possibly help me on the right track ?

Sincerest thanks in advance

Spas
you can use fit on page plugin so that large images can be re-sized
Thanks for your suggestion .m. I already have that plugin installed.

This particular image falls inside my max image settings. The issue is not the actual size of the image but the fact that is isn't auto resizing according to browser width.

This is especially important for mobile users that don't use Tapatalk. I want to images to resize and fully scale in real time according to the width of the page.

Thanks and sorry if I didn't explain myself properly in the OP

Spas
for the mobile users you can use GoMobile theme along with TapaTalk

I use below style to resize the images
.post_content img {max-width: 820px!important; height: auto!important;}


for the mobile theme, it can be
.post_content img {max-width: 420px!important; height: auto!important;}
Thanks a lot .m. I'll definitely look into the GoMobile theme!

Thanks for the suggestion of the .post content img settings. did you create a new stylesheet for that ?

Thanks again

Spas
^ required style codes can be added to bottom of the stylesheet (eg. global.css, editing through admin panel, advanced edit mode)
Thanks very much, I'll go give that a go and report back!

whoa, so easy when you know how!

Thanks very much .m. for your assistance. It now works perfectly without messing up my Avatars.

I had to change max-width to 100% to allow fluid resizing. Here is the code I used based on yours. The problem was isolating the max-width to 'Only' the post content so it didn't upsaet other forum images.

.post_content img {max-width: 100%!important; height: auto!important;}

You won't belive how many hours I've spent trying to figure this out.. I can only hope it helps others whom are trying to find the same answer.

Cheers.. I owe you a beer Smile

Spas

Just wanted to share a quick update.

Here is the same post with an idea of browser width in relation to this page for scale purposes.

As you can see, the image now resizes to scale perfectly, even with the browser very small. Apologies for blurring everything out, I didn't want to appear to be advertising anything contentwise on my site.

[Image: postbodyfixed.png]

The software is great and I'm seriously considering importing my other SMF forum over to MyBB as it's so much easier to work with.

Cheers guys

Spas