TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Those HTML attributes you never use

490 pointsby makaimcabout 3 years ago

27 comments

ktpsnsabout 3 years ago
The graveyard of HTML attributes which never gained public attention&#x2F;usage is large and full of useful ideas.<p>My favourite was relational links such as<p><pre><code> &lt;link rel=&#x27;first&#x27; href=&#x27;&#x2F;de&#x27; title=&#x27;Homepage&#x27; &#x2F;&gt; &lt;link rel=&#x27;prev&#x27; href=&#x27;&#x2F;some&#x2F;bunnies.php&#x27; title=&#x27;Previous Page about bunnies&#x27; &#x2F;&gt; &lt;link rel=&#x27;next&#x27; href=&#x27;&#x2F;some&#x2F;cats.php&#x27; title=&#x27;Next page about cats&#x27; &#x2F;&gt; &lt;link rel=&quot;copyright&quot; href=&quot;&#x2F;de&#x2F;impressum.php&quot; title=&quot;Impressum&quot;&gt; &lt;link rel=&quot;alternate&quot; href=&quot;&#x2F;gr&#x2F;samepage.php&quot; hreflang=&quot;gr&quot; title=&quot;Page name in greek&quot;&gt; </code></pre> 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.<p>Some relations survived (such as rel=&quot;search&quot; for custom search pages), some got killed-by-ecosystem (such as RSS).
评论 #30906815 未加载
评论 #30906541 未加载
评论 #30912558 未加载
评论 #30909752 未加载
评论 #30913212 未加载
评论 #30912848 未加载
评论 #30908762 未加载
评论 #30916085 未加载
评论 #30909988 未加载
评论 #30911093 未加载
toastalabout 3 years ago
I&#x27;m pretty bummed the title attribute on stylesheets didn&#x27;t get the love it needed. We had a native, built-in theme switcher (except Chromium) that would have been prefered to some of the contemporary options of needing to put it behind user preferences. If it could hawe been fixed to persist the selection as well as not load unused, then we&#x27;d maybe see a different space.
评论 #30905940 未加载
评论 #30908650 未加载
inopinatusabout 3 years ago
I highly recommend re-reading the entire formal standard for technologies you work with routinely, on a roughly annual basis. It&#x27;s a triple whammy of refresher, update, and niche discovery.<p>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 <i>Essential System Administration</i> (2002), possibly in the form of reading every manpage in your local Unix base system.
dgb23about 3 years ago
The form attribute on fields is very useful to decouple the What from the How (it is laid out on the screen). You might for example want an upload widget, which does a separate request, right next to some other fields. Instead of wrapping things in forms (which you cannot nest) you can now freely lay out your document. Similarly you might want several fields or buttons spread across your document and don&#x27;t want to wrap everything with a big form, or several forms.
评论 #30906354 未加载
评论 #30906188 未加载
acattonabout 3 years ago
&gt; The `download` Attribute For The &lt;a&gt; Element<p>This can also be done by the webserver with Content-Disposition. [1]<p>But it&#x27;s cool, I didn&#x27;t know this could be done with HTML, it offers a lot of possibilities.<p>[1] <a href="https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;HTTP&#x2F;Headers&#x2F;Content-Disposition#examples" rel="nofollow">https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;HTTP&#x2F;Headers&#x2F;Co...</a>
评论 #30906045 未加载
评论 #30906348 未加载
评论 #30906308 未加载
评论 #30913240 未加载
评论 #30906578 未加载
nkozyraabout 3 years ago
enterkeyhint doesn&#x27;t do anything on Chrome on Android.<p>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&#x2F;Edge or on Safari&#x2F;Firefox but not Chrome, etc? Specs are great, but near universal, reliably similar implementation is key.<p>In a lot of cases it means you have to build edge case UX. I&#x27;d rather lean on UX that&#x27;s mostly under my control and not at the whim of browser adoption.<p>I did at least find some blink discussion on it: <a href="https:&#x2F;&#x2F;groups.google.com&#x2F;a&#x2F;chromium.org&#x2F;g&#x2F;blink-dev&#x2F;c&#x2F;Hfe5xktjSV8?pli=1" rel="nofollow">https:&#x2F;&#x2F;groups.google.com&#x2F;a&#x2F;chromium.org&#x2F;g&#x2F;blink-dev&#x2F;c&#x2F;Hfe5x...</a>
评论 #30905229 未加载
chrisfinazzoabout 3 years ago
&lt;cite&gt; is a bit of a surprise to me. The Standard Ebooks[1] project uses almost religiously it when styling blockquotes.<p>[1]: <a href="https:&#x2F;&#x2F;standardebooks.org&#x2F;manual&#x2F;1.6.3&#x2F;single-page#5.8" rel="nofollow">https:&#x2F;&#x2F;standardebooks.org&#x2F;manual&#x2F;1.6.3&#x2F;single-page#5.8</a><p>I <i>love</i> the &lt;download&gt; attribute, it&#x27;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&#x27;re careful, it&#x27;s wonderful.<p>Native lazy loading support is coming to a bunch of things in the near future, if it&#x27;s not there already, so this one is living on borrowed time.<p>If you&#x27;ve ever tried to implement CSP on a site, crossorigin and integrity should be famiilar - alas, CSP is <i>hard</i>, but you already knew that didn&#x27;t you :)
评论 #30907300 未加载
cfjabout 3 years ago
Seeing the download attribute mentionend felt weirdly nostalgic. I wrote a short blog post about that attribute which shot up to the number one spot here on HN when I submitted it back in 2013[0].<p>In the nine years since that post, I have not once used it in a real project.<p>[0]: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=5594791" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=5594791</a>
NKosmatosabout 3 years ago
&lt;blink&gt;Came here for deprecated attributes, but found an informative article.&lt;&#x2F;blink&gt;
评论 #30904915 未加载
andrewingramabout 3 years ago
When I worked on themes for a blog engine back in 2005&#x2F;2006, I used the titled stylesheets to allow me to switch between themes quickly. There was actually an upper limit on how many you could have before browsers started breaking, but it was still a useful capability.
TAKEMYMONEYabout 3 years ago
No one uses the &lt;a&gt; `download` attribute for the reason we stopped forcing users to open new browser windows with target=&quot;_blank&quot;, they know how to download (or open a new tab) if they want to, and it breaks or confuses more often than it works.<p>Who&#x27;s using (or even heard of) &lt;abbr&gt; and &lt;dfn&gt; <i>without</i> `title`? I kinda thought that was what made them most useful, providing the full unabbreviated version for example.
评论 #30907983 未加载
评论 #30909580 未加载
评论 #30908292 未加载
评论 #30909063 未加载
评论 #30913228 未加载
评论 #30909955 未加载
评论 #30914577 未加载
评论 #30908716 未加载
评论 #30949245 未加载
ravenstineabout 3 years ago
I expected to read this article and think &quot;yeah, no wonder I don&#x27;t use those&quot;, but those first 2 in particular are pretty dope. The &quot;Page Style&quot; dropdown in the browser is something I never really thought you could add to. I think I know the next thing I&#x27;ll play with in my next personal project. :D
评论 #30905407 未加载
评论 #30916386 未加载
agumonkeyabout 3 years ago
The enterkeyhint is brilliant. Yet it&#x27;s sad it can&#x27;t affect physical keyboards because it would be an ergonomic boom for all the non tech savvy people (input order and submission is often slowed down and confusing due to that, yet something that was leaner in old as400 terminal UIs).<p>Maybe keyboards will have a few lcd keys, or for cost cutting a colored led keys to match these kind of hints
评论 #30909201 未加载
评论 #30909457 未加载
评论 #30909515 未加载
评论 #30907121 未加载
efortisabout 3 years ago
My favorite: &lt;abbr title=&quot;Abbreviation&quot;&gt;abbr&lt;&#x2F;abbr&gt;
评论 #30910277 未加载
martin_aabout 3 years ago
&gt; The decoding Attribute For The &lt;img&gt; Element<p>This is an interesting one, although I find native lazy-loading with the &quot;loading&quot;-attribute more interesting: <a href="https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;HTML&#x2F;Element&#x2F;img#attr-loading" rel="nofollow">https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;HTML&#x2F;Element&#x2F;im...</a>
评论 #30907784 未加载
thomasflabout 3 years ago
The web standards are large and complex. I still discover new parts of the standards almost every month, even if I have made websites since the stoneage, in 1995. The title attribute of stylesheets was new to me.
hk__2about 3 years ago
Note that instead of using an input type=text and enterkeyhint=search, you can use input type=search.
评论 #30905615 未加载
评论 #30906377 未加载
评论 #30907758 未加载
评论 #30906764 未加载
评论 #30908833 未加载
nlabout 3 years ago
I have a recollection of early versions of Firefox exposing the stylesheet switcher in the footer chrome. Maybe it was an extension though? I can&#x27;t find references to it online.
评论 #30906869 未加载
sebazzzabout 3 years ago
&gt; The title Attribute On Stylesheets<p>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).
bugmen0tabout 3 years ago
Nit: `integrity` also works for stylesheets, not just scripts
评论 #30908851 未加载
maps7about 3 years ago
Cool. Most of these were new to me too. I will likely forget them again until I read about them in another blog post but interesting nonetheless.
zhte415about 3 years ago
The article didn&#x27;t use the blockquote cite attribute in the blockquote that explains why it&#x27;s not used much.<p>This is perhaps internally consistent.
jer0meabout 3 years ago
I also like the `formaction` attribute that can be added to buttons and input-buttons in forms to specify different actions. I used it to let users choose between multiple payment methods.
charcircuitabout 3 years ago
Page Style is useless because there is no persistence. Even navigating to another page on that same website will reset it back to default.
Melatonicabout 3 years ago
Would be nice to be able to rely on HTML attributes for filtering but sadly they are just too easy to spoof
ameliusabout 3 years ago
Why aren&#x27;t all attributes CSS properties?
评论 #30904888 未加载
评论 #30905100 未加载
hiccuphippoabout 3 years ago
Their cookie consent window is one of the most confusing ones I&#x27;ve seen: &quot;We use cookies for login, checkout and stats. Learn more in our privacy settings.&quot; Followed by two buttons: &quot;No, thanks&quot; and &quot;It&#x27;s okay&quot;.<p>No thanks... I don&#x27;t want to learn about your privacy settings? It&#x27;s okay... store everything?
评论 #30905512 未加载
评论 #30905535 未加载
评论 #30905827 未加载