490 points · by makaimc · 4y ago · 163 comments
My favourite was relational links such as
<link rel='first' href='/de' title='Homepage' />
<link rel='prev' href='/some/bunnies.php' title='Previous Page about bunnies' />
<link rel='next' href='/some/cats.php' title='Next page about cats' />
<link rel="copyright" href="/de/impressum.php" title="Impressum">
<link rel="alternate" href="/gr/samepage.php" hreflang="gr" title="Page name in greek">
Opera was the only browser which had a toolbar with these relational links. This was around mid-2000. Unfortunately, this toolbar never survived or got taken over by other browsers.Some relations survived (such as rel="search" for custom search pages), some got killed-by-ecosystem (such as RSS).
Frefox had it to, it's this famous bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=2800 opened 24 years ago.
They had a toolbar for it for a while, and I used it for forums and search results. And then they got rid of the toolbar, and the rel link because used only for search engines.
As of 2019, Bing was looking at those links for URL discovery. https://twitter.com/CoperniX/status/1108790528773021696
<input type="slider" min="0" max="100" step="10" name="foo">
<input type="toggle" value="true" name="bar">And a "toggle" input is just a checkbox.
I wrote something like that for my homepage, although as I only needed to switch between two styles and I'm not a front-end person, I didn't bother with an actual selection drop-down and just wrote a toggle that cycles through all alternate stylesheets one at a time.
I just wish it got a higher priority by browsers to have good built-ins.
I attribute this advice to Æleen Frisch; albeit without pulling my very dog-eared copy from the stacks, I recall that words to similar effect can be found in the epochal Essential System Administration (2002), possibly in the form of reading every manpage in your local Unix base system.
The button's name (optionally also its description) and to some degree its position in the DOM order (what heading and/or other form elements precedes it) needs to be sufficient to convey what will happen when it's used.
Each row can be its own form and you still end up with valid html.
This can also be done by the webserver with Content-Disposition. [1]
But it's cool, I didn't know this could be done with HTML, it offers a lot of possibilities.
[1] https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Co...
There is no straightforward way[0] for you to gracefully handle an error, which is quite an oversight once you factor in that network isn’t always reliable.
Having used it at first, I switched to server-side logic where I return data with Content-Disposition header if everything went well or redirect the user to show a proper error message in case of a problem.
[0] I imagine this could be worked around with some JS-based preflight or other trickery—which sounds like a suitable solution only if you have no control over the headers returned for some reason.
Though that is at least consistent with other download options like right-click/save-link-as, so is probably not incorrect behaviour.
I’m OK with “Save as” (“Download linked file”, etc.) behaving as it does: it is more or less intuitively clear that with it we sort of “cheat” and use browser’s semi-hidden feature to interact with a website in ways not necessarily intended by its engineers. With the download attribute, however, any confusing outcome falls squarely on me, the developer, so I’d rather stick with plain links and response headers as a mechanism I have more control over.
There may be some workarounds to make download behave adequately in case of an error, such as having your server behave in some way that causes browser’s fetch sequence to fail with a low-level error. Unless I’m missing something, it seems like proper network error is the only condition under which download can actually fail, and I don’t think a typical web framework setup is equipped to intentionally cause that to happen. I doubt it’s worth the bother—if you have control over the server then why not drop the attribute and just return the appropriate headers.
1. Use JS, in which case one can handle errors and otherwise be involved in the request / response process. However, if you wish to offer a "download" funciton, this necessitates downloading all the data into JS memory before offering it to the user.
2. Use form-posting with `Content-Disposition`. One can no longer be involved with the request and response. And any response which does not have `Content-Disposition` will result in the browser redirecting. However, the user will be able to directly stream the download without your page being involved beyond initiating the request.
Since the data downloads are gigabytes in our case, we opted for (2). But I would also love to hear if I'm wrong about this trade-off.
(Correction: per spec, the domain does enter the picture in that cross-domain <a download> is not supposed to work at all without Content-Disposition response header; that’s slightly different matter to what’s discussed.)
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#...
Maybe just me.
Which kind of illustrates why a lot of these things are not well-known. Why do something that that works on Firefox but not Chrome/Edge or on Safari/Firefox but not Chrome, etc? Specs are great, but near universal, reliably similar implementation is key.
In a lot of cases it means you have to build edge case UX. I'd rather lean on UX that's mostly under my control and not at the whim of browser adoption.
I did at least find some blink discussion on it: https://groups.google.com/a/chromium.org/g/blink-dev/c/Hfe5x...
This site suggests that enterkeyhint is supported on Chrome: https://caniuse.com/mdn-html_global_attributes_enterkeyhint
My own testing also shows that it works. Using the "search" value of the attribute, I was able to change the enter button into a magnifying glass.
[1]: https://standardebooks.org/manual/1.6.3/single-page#5.8
I love the <download> attribute, it's a quick way to use the default file download mechanisms without having to bother the user with opening a link or prompting. I realize there is the potential for abuse, but if you're careful, it's wonderful.
Native lazy loading support is coming to a bunch of things in the near future, if it's not there already, so this one is living on borrowed time.
If you've ever tried to implement CSP on a site, crossorigin and integrity should be famiilar - alas, CSP is hard, but you already knew that didn't you :)
Writing "<download>", with the word in angle brackets, makes it look like an element but it's not, download is an element attribute.
I am aware of the distinction, I only used that way b/c HN doesn't really have a good way to indicate code without multiple spaces or just blindly using the ` character which is...not great.
How to use <cite> is often misunderstood. Many think it can be used to identify the author of a quotation but it should only be used to name the work a quotation is from. Standard Ebook placed it inside the <blockquote> but I've also seen it placed after <blockquote>, I don't know whether both are considered correct or if it's a point of disagreement; to me, <blockquote> should contain only the quoted material itself but I understand the appeal of having the quote and its source be neatly contained within one semantic element.
Using the Markdown convention of putting backticks around `code` may not be great but at least it won't be confused for the wrong actual code.
I recall in a (lost) blog theme I had at one point in time I'd scrounged a nice bit of CSS to add cite attributes visibly appended to blockquote and q elements. Exposing it to the user is possible in just pure CSS, but it is a bit of a shame that browsers didn't style it by default so many people didn't learn it was a thing.
<q cite="https://www.w3.org/Consortium/">To lead the
World Wide Web to its full potential by developing protocols and
guidelines that ensure long-term growth for the Web</q>
q::after {
content: attr(cite);
}
That will show the source URL for a quote but it's not very useful, the URL isn't clickable (unless you wrap the whole <q> in a link), it's not even selectable text. blockquote::after, q::after {
content: " - " attr(cite);
display: block;
font-style: italic;
}
Should do the trick nicely.In the nine years since that post, I have not once used it in a real project.
Yeah, I had the same cynical assumption before reading.
All in all, I can't remember coming across a deprecated HTML feature that I needed and didn't already have a better alternative.
Furthermore I think you can still use this stuff. Apache and Lighttpd are still perfectly fine web servers depending on the use case. Also nginx supports server-side includes and fastCGI.
None of the attributes in the article are deprecated, some are underimplemented (alternative stylesheets).
What is taking so long? /s
(Only a bit of sarcasm there, I actually would like to know...)
Who's using (or even heard of) <abbr> and <dfn> without `title`? I kinda thought that was what made them most useful, providing the full unabbreviated version for example.
That said, opening links in a new tab/window is the less-breaky approach these days, since every page that the clicks came from is a mess of infinite scroll and reactive components and all sorts of other state that gets lost by clicking to another page and trying to go back.
Target _blank keeps the title of your page on the screen and clickable.
That's before the accessibility concerns, users don't expect pop-ups anymore and find this confusing and difficult to navigate.
Also, it allows you to ensure that if you have a button that says 'download', it will actually download the file instead of having it replace the application---the principle of least surprise.
I use it when setting acronyms in small caps. Their spelling can look like screaming otherwise.
not sure about <dfn> without a title though.
Or imagine web browsers providing upload progress ;)
But well, designers like to give all that their custom design.
https://developer.mozilla.org/en-US/docs/Web/API/FormData
Uhh, JSON would have been nice I guess?
When I got frustrated with the user needing to be able to re-edit a form with waaay to many fields and the option to add more fields of various exotic types. I wrote a hilarious hack where I just went over the input elements and elm.setAttribute("value", elm.value). Then I rip out the entire form innerHTML, POST it and store it in the database. Want to edit it again? Here you go! When displaying the content wrap the form in: <fieldset disabled="disabled"> and add some border:0;color:black
For such a terrible idea it looked remarkably clean.
Maybe keyboards will have a few lcd keys, or for cost cutting a colored led keys to match these kind of hints
> non tech savvy people
Tech, in many situations that intersect with non-tech people, is now some form of touchscreen with an onscreen keyboard.
Exceptions are corporate HR departments, whose hardware, software, and flow seem to ignore the fact that phones are the primary Internet device now, not PCs like it was in the 90s.
If your actual job requires you to use a PC, you probably simply just need to learn to use a keyboard because the apps you are using are going to be complex to, e.g. Office suite, etc.
it's not the keyboard, it's the meaning 'RET' has for a particular form. It can be a per field 'accept then go next' it can be 'validate the local group', 'validate the main form and submit it back', 'accept a partial choice but don't change focus'. That's why the hint is brilliant, it removes confusion.
Also people who need this knowledge are never given good tutors. It's mostly "deal with it, and be fast or else.."
https://en.wikipedia.org/wiki/Optimus_Maximus_keyboard
Apple has a patent on the concept; maybe there’s still one in our future:
Also, it's right in front of your eyes, so it's clear when it says something else. Your computer keyboard isn't, and people don't usually look at the enter key before hitting it (even hunt-and-peck typers should have the enter key committed to muscle memory). Forcing people to look down at their keyboards before hitting enter would make ergonomics worse, not better.
There are enormous numbers of keyboards with per-key RGB lighting available. And the host OS can control them (right now my keyboard is lighting up with the music)
I think this is one reason people quickly move on to using popover libraries for simple popovers.
This is an interesting one, although I find native lazy-loading with the "loading"-attribute more interesting: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/im...
I found some posts from from 2004 which does refer to the icon:
https://fantasai.inkedblade.net/weblog/2004/firefox-altss/
https://web.archive.org/web/20041103090311/http://weblogs.mo...
I wish I could find some screenshots!
(The menu item was actually mentioned in the article linked here.)
w3.org used to feature this, you could view the website in any of the stylesheets they offered, which were a bunch (about 5-10 if I recall correctly).
This is perhaps internally consistent.
No thanks... I don't want to learn about your privacy settings? It's okay... store everything?
“Legitimate interest” is proof that “your privacy is valuable to us” just means “we are happy to shatter your privacy in exchange for some value”. Every “legitimate interest” box basically says “we see your preference, but fuck you and your preferences”.
Really needs a course correct to find a better balance...
It’s not perfect, but it helps.