benschwarz / developers.whatwg.org

Used to create the contents of developers.whatwg.org
http://developers.whatwg.org/
198 stars 39 forks source link

Don't stretch narrow images in handheld view #73

Closed Smylers closed 11 years ago

Smylers commented 11 years ago

If the handheld CSS has been selected then setting images to be full-width was stretching narrow images (but leaving their height alone), distorting them. For example see the sample rendering images in this section: http://developers.whatwg.org/states-of-the-type-attribute.html#range-state-%28type=range%29

This can be seen in a desktop browser simply by resizing the window to under 960px.

Fix the problem by not resizing images that already fit.

Instead, set a maximum width so that large images get scaled down to fit, and ensure the height stays in proportion with the width.

benschwarz commented 11 years ago

Great stuff.