I’m working on a mobile friendly website & I’m a bit baffled by this issue I currently have with an image attribute.
I have its dimensions set as percentage. It displays fine with IE7+, Firefox & Chrome but not Safari. It distorts the image drastically!
Do I need to use JavaScript in order to display the image properly?
Thanks in advance…
Code in question:
Remove the height attribute and the browser will scale it proportionally.
Putting percentages in the height and width attributes is not strictly copacetic though. From the HTML5 spec
If you’re set on styling this inline rather than with a style sheet, you’d be better off with a style attribute: