Removing the align='right'
property assignment is causing the img element to have its display property set to 'block'. Without the align='right'
property, your code will display 'inline' on jsFiddle.
<body>
<img style="cursor: pointer; width: auto; height: auto; display: inline;" src="http://www.kidsgen.com/fables_and_fairytales/images/rapunzel.gif" alt="rapunzel" title="rapunzel" />
</body>
alert($('img:first').css('display')); // alerts 'inline'
It is important to note that img tags are typically inline elements by default. However, when align='right'
is set inside the img tag, the display property cannot be set back to inline even with the following line of code:
$('img:first').css('display', 'inline');