Live data from Hacker News

Tags to make HTML work like you expect

blog.jim-nielsen.com

1–10 of 248 posts

Re: Tags to make HTML work like you expect

#3
>

s/lange/lang/

>

Don’t need the “.0”. In fact, the atrocious incomplete spec of this stuff https://www.w3.org/TR/css-viewport-1/> specifies using strtod to parse the number, which is locale dependent, so in theory on a locale that uses a different decimal separator (e.g. French), the “.0” will be ignored.

I have yet to test whether misbehaves (parsing as 1 instead of 1½) with LC_NUMERIC=fr_FR.UTF-8 on any user agents.

Re: Tags to make HTML work like you expect

#4
Note that and auto-close and don't need to be terminated.

Also, wrapping the tags in an actual is optional.

You also don't need the quotes as long the attribute doesn't have spaces or the like; is OK.

(kind of pointless as the average website fetches a bazillion bytes of javascript for every page load nowadays, but sometimes slimming things down as much as possible can be fun and satisfying)

Re: Tags to make HTML work like you expect

#5

I often reach for the HTML5 boilerplate for things like this: https://github.com/h5bp/html5-boilerplate/blob/main/dist/ind...

There is some irony in then-Facebook's proprietary metadata lines being in there (the "og:..." lines). Now with their name being "Meta", it looks even more proprietary than before.

Maybe the name was never about the Metaverse at all...

Re: Tags to make HTML work like you expect

#6

Note that and auto-close and don't need to be terminated. Also, wrapping the tags in an actual is optional. You also don't need the quotes as long the attribute doesn't have spaces or the like; is OK. (kind of pointless as the average website fetches a bazillion bytes of javascript for every page load nowadays, but sometimes slimming things down as much as possible can be fun and satisfying)

, and start and end tags are all optional. In practice, you shouldn’t omit the start tag because of the lang attribute, but the others never need any attributes. (If you’re putting attributes or classes on the body element, consider whether the html element is more appropriate.) It’s a long time since I wrote , , , or .

Re: Tags to make HTML work like you expect

#8

> s/lange/lang/ > Don’t need the “.0”. In fact, the atrocious incomplete spec of this stuff https://www.w3.org/TR/css-viewport-1/ > specifies using strtod to parse the number, which is locale dependent , so in theory on a locale that uses a different decimal separator (e.g. French), the “.0” will be ignored. I have yet to test whether misbehaves (parsing as 1 instead of 1½) with LC_NUMERIC=fr_FR.UTF-8 on any user age…

Wow. This reminds me of Google Sheets formulas, where function parameters are separated with , or ; depending on locale.

Re: Tags to make HTML work like you expect

#10

> s/lange/lang/ > Don’t need the “.0”. In fact, the atrocious incomplete spec of this stuff https://www.w3.org/TR/css-viewport-1/ > specifies using strtod to parse the number, which is locale dependent , so in theory on a locale that uses a different decimal separator (e.g. French), the “.0” will be ignored. I have yet to test whether misbehaves (parsing as 1 instead of 1½) with LC_NUMERIC=fr_FR.UTF-8 on any user age…

Wow. This reminds me of Google Sheets formulas, where function parameters are separated with , or ; depending on locale.

Same as Excel and LibreOffice surely?
Post reply on HN