Width Before Height

When listing the HTML dimension attributes belonging to tags such as <img> and <video>, we have the option of including width before height, and vice versa. For example:

<video width="320" height="240">

which is the equivalent to

<video height="240" width="320">

Or

<img src="shihtzu.jpg" width="50" height="50" alt="">

which is equal to

<img src="shihtzu.jpg" height="50" width="50" alt="">

The convention, however, is to list width before height. Browsers do it. Image previewers do it.

In Firefox, for example, if you hover your mouse over an image and perform a context-click (right-click for right handers), choose View Image

[Hover, then context-click over image]
Hover, then context-click over image
then hover your mouse over the title tab, you’ll see the image’s width listed before its height.

[Hover mouse over browser tab]
Hover mouse over browser tab
And, lastly, in Windows 8.1, if you view an image in Windows Photo Viewer and bring up the Properties panel (Alt + Enter), then click the Details tab, you’ll see the image’s width listed before height under the Image heading.

[The Dimensions option in Windows’ Photo Viewer Properties panel]
The Dimensions option in Windows’ Photo Viewer Properties panel
Hope I’ve convinced you.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.