MyBB Community Forums
css help with image resizing - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Themes (https://community.mybb.com/forum-103.html)
+---- Forum: Theme Support (https://community.mybb.com/forum-10.html)
+---- Thread: css help with image resizing (/thread-156273.html)



css help with image resizing - andrewjs18 - 2014-07-19

Hi folks,

I'm trying to downsize my plugin list and as such, get rid of the resizing plugin and just use css.

right now the following code is being used and works in chrome, but not firefox:

.post_body img {

max-width:100%;
height: auto;

}

any tips for making it work correctly with firefox?


RE: css help with image resizing - mmadhankumar - 2014-07-20

use width instead of max-width....

.post_body img {
    width:100%;
}



RE: css help with image resizing - andrewjs18 - 2014-07-20

(2014-07-20, 06:33 AM)mmadhankumar Wrote: use width instead of max-width....

.post_body img {
    width:100%;
}

using width stretches every image to 100% and distorts some.


RE: css help with image resizing - Eric - 2014-07-20

I believe this should work how you'd like:

.post_body img {
    width: auto;
    max-width: 100%;
}



RE: css help with image resizing - andrewjs18 - 2014-07-20

(2014-07-20, 08:05 PM)Eric J. Wrote: I believe this should work how you'd like:

.post_body img {
    width: auto;
    max-width: 100%;
}

still no dice.

works fine in chrome, not in firefox 30.0

leefish helped me out with this.

the fix was to add this to the postbit template:

style="table-layout: fixed;

so the entire line looks like:

<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="table-layout: fixed;