bellroy / lesswrong

Less Wrong platform
http://lesswrong.org/
Other
45 stars 23 forks source link

Tweak post CSS to shrink images #461

Open frediy opened 9 years ago

frediy commented 9 years ago

From gwe...@gmail.com on November 19, 2012 07:41:11

When adding an image link, the default is to transclude it at whatever raw size the image is. On posts, this can lead to an ugly underlap effect where a huge image scrolls off the screen and under the sidebars until the image is manually resized and uploaded. This apparently can be fixed by a standard CSS option to shrink images to fit the body of a post's width: 'fluid images'; see http://unstoppablerobotninja.com/entry/fluid-images/ http://blog.kurtschindler.net/post/flexible-dynamically-resizing-images-with-css http://stackoverflow.com/questions/787839/resize-image-proportionally-with-css For example, on gwern.net I had the same problem and fixed it with:

img { max-width: 100%; height: auto; width: auto\9; /* ie8 */ }

Something like that might work for posts.

Original issue: http://code.google.com/p/lesswrong/issues/detail?id=363

frediy commented 9 years ago

From gwe...@gmail.com on November 29, 2012 15:19:18

Seems to be an issue for comments too: http://lesswrong.com/lw/fp5/2012_survey_results/7xhs (I manually shrank the images before uploading, but they're still not rendering cleanly.)