Login  Register

Re: Image sizing

Posted by DavidJCobb on Nov 24, 2011; 11:03pm
URL: https://support.nabble.com/Image-sizing-tp7027028p7029651.html

Harvey44 wrote
Any way to use the full width (say 750) and have the photo auto-resize no matter how many times it is quoted?
I went to your forum and tried out the following CSS in Firefox 8. It seemed to work. Didn't test it for other browsers, though.

/* This is the CSS from your forum member, slightly 
   modified. */
.nabble .message-text img {
    display: inline-block;
    height: auto;
    margin-bottom: 5px;
    margin-top: 5px;
    max-width: 100%;
}

/* Here, we override a default CSS rule. Without this, 
   max-width from earlier will completely break for 
   quoted images. */
.nabble div.quote {
    display: block!important;
}

Makes images use as much width as possible, without overflowing past the size of their container (post, quote, nested quote) or creating a scrollbar. Even if you change the width of posts/pages/the embedded forum, this should still work without you having to change values.