Email developers, as you know, are forcibly trapped in the 90s when it comes to HTML. (Or maybe trapped in a dystopia where Web-0.9-era HTML4 mixes with some time-jumping CSS3.)
So they’re used to setting the ancient
height HTML attributeson an element (not to be confused with
height CSS properties). For example, to give a table cell a certain pixel width:
The rule being a unit-less numeric string represents a length in pixels. A numeric string followed by
% means a percentage.
For the longest time, I thought those were the only 2 options, either
10%, and it was invalid HTML to even attempt to use
10px (let alone other units not supported in HTML4, like
Turns out it’s not invalid. So many apps were forgiving and assumed you meant just
10 that the forgiveness made its way into the current HTML standard. Yes, in the standard,
height are marked obsolete in favor of CSS. But if you do use them, the parser looks for a sequence of one or more numeric characters, and any non-numeric characters after that are simply ignored.
The path through the spec goes like this:
heightmap to dimensions
9at the start, after stripping whitespace, is the effective value — regardless of what follows:
This means the following values are all valid and interpreted as 10 pixels:
Doesn’t mean you should push your luck, as people reading your code may think you’re wrong (I certainly used to). But teeeeechnically it’s allowed. Interesting, I thought.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.