Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+3 votes
862 views
in Q2A Core by
I am using Markdown Editor for my Q&A site. When a user add a large image, it overflows. Is there any way to auto fix/resize the images.

Thank you.

2 Answers

+2 votes
by
edited by

add a css rule:

.entry-content img {

    max-width: 500px;

   width: expression(this.width > 500 ? 500: true);

}

I don't know about the width: expression part, just got it from the net; seems IE6 doesn't understand max-width.

0 votes
by

I had that same problem and for some reason noahs solution did not work for me.

But what did work was:

.entry-content img[style] {max-width:90% !important;height:auto !important;}

read here

http://www.sitepoint.com/forums/showthread.php?434432-Can-you-resize-image-with-CSS

and here

http://www.pmob.co.uk/temp/3col/3col-fixed-side-01.htm

(making the window larger and smaller)

 

 

...