title: Specifying only width or height for an img element
body: <p>If only one of the attributes <code>height</code> or <code>width</code> is set for an <code>img</code> element, most browsers seem to keep the proportions of the image.</p>
  
  <p>This is from the HTML 4.01 reference:</p>
  
  <blockquote>
    <p>When the object is an image, it is scaled. User agents should do their
    best to scale an object or image to match the width and height
    specified by the author.</p>
  </blockquote>
  
  <p><a href="http://www.w3.org/TR/html401/struct/objects.html#edef-IMG" rel="noreferrer">http://www.w3.org/TR/html401/struct/objects.html#edef-IMG</a></p>
  
  <p>Would it be wrong of a browser to scale the image non-uniformly, that is changing only the height or the width of an image?</p>
  
  <p>Update 2015-08-12: <a href="http://www.dillo.org/" rel="noreferrer">Dillo</a> (version 3.0.4) is an example of a browser which does not keep the proportions of an image if only <em>height</em> or only <em>width</em> is set.</p>