Live data from Hacker News

Cool HTML elements nobody uses

tapajyoti-bose.medium.com

41–50 of 111 posts

Re: Cool HTML elements nobody uses

#42
post #27
post #7

I am old enough to remember development when image maps were still common for things like headers and big hero homepage navigation images. I'd like to add which acts like an img tag and submit button that submits the clicked X and Y essentially as two separate inputs Here's an MDN example showing X and Y position in GET string on click. - https://mdn.github.io/learning-area/html/forms/image-type-ex...

Trip down memory lane: Internet Explorer didn’t quite interpret the standard correctly and sent the coordinates as floating point numbers. If you had this input[type=image] on a ASP.NET WebForms page, this then caused ASP.NET WebForms to crash, as it tried to interpret the postback arguments of the X/Y coordinates as integers. I think this was later fixed by patching Internet Explorer.

Trip down memory lane: Internet Explorer didn’t quite interpret the standard correctly. Full stop. Anything said after this is just using words for vanity ;-)

Re: Cool HTML elements nobody uses

#43

Having used all of these in the past, here's why this is the case: 1. meter/progress - default style looks dated, styling works different on different browsers, the color scale options are confusing 2. sup/sub & 7. abbr - these are only useful for page content (as opposed to site design), which is usually WYSIWYG or something like Markdown. Many editors/parsers don't support it, at least by default. 4. map/area - it'…

That was my first thought... if people don't use these very old elements any more, there's probably a good Chesterson's fence-type reason. Frames seemed really cool when I first saw them too, until I actually started trying to support them.

Frames died when AJAX became available. People were bastardizing frames so that they could change the content in a window without refershing the entire window.

Re: Cool HTML elements nobody uses

#46
`details`/`summary` and `progress` have decent default styles in picocss. I was under the impression that these elements were used much more often in "modern" HTML than, for example, `map`/`area` or `object` (yuck!).

Re: Cool HTML elements nobody uses

#47
post #36

Having used all of these in the past, here's why this is the case: 1. meter/progress - default style looks dated, styling works different on different browsers, the color scale options are confusing 2. sup/sub & 7. abbr - these are only useful for page content (as opposed to site design), which is usually WYSIWYG or something like Markdown. Many editors/parsers don't support it, at least by default. 4. map/area - it'…

For some reason makes me anxious. Is there some memory of the Flash/ActionScript days, or maybe ActiveX or something, that causes me to frown at seeing a mention of ?

is supposed to be for exposing modules from hosted runtimes into the host execution-context as, well, objects (in the OOP sense. Or the COM sense, I suppose.)

The original use-case would have been something like: imagine you code a game physics engine in Java, and deploy it as a Java applet. You can embed that physics engine into a page as an — and then consume it as a local API using JavaScript embedded on the same page.

(And yes, this is almost certainly the real reason JavaScript is called "JavaScript." When it was created, it was precisely positioned as a glue language for consuming/driving Java-applet APIs!)

Java-applet-based APIs (and their Windows-proprietary ActiveX cousins) are dead, so there's no real reason to care about any more. As long as the browser knows how to render the media if you navigate directly to its URL, you can just use an .

Re: Cool HTML elements nobody uses

#48

and has the problem that they change the line height. So if you have an paragraph and one line contains "Nice ground with 42 m² grass" then that line is taller than all the other lines, which makes it rather ugly. So I automatically converts all m 2 and similar into the unicode symbols: https://en.wikipedia.org/wiki/Unicode_subscripts_and_supersc...

> So I automatically converts all m2 and similar into the unicode symbols

Nice in theory, but only works for trivial cases. Most old-school use of is as a quick-and-dirty pre-MathML way of rendering equations as (accessible) text in browsers. (The people who didn't care about accessibility rendered TeX to an image and embedded it.)

Re: Cool HTML elements nobody uses

#49

My favorite (non-conforming, do-not-use) element is . It switches the browser's parsing context to "generic raw text"; it emits any "child" markup as-is, without parsing it. [0] https://jsfiddle.net/spdustin/y4m3qd71/1/

I believe you can also just write . (See https://stackoverflow.com/questions/3302648/should-i-use-cda...). It's normally only used to wrap non-HTML content inside and ; but you could put "HTML that should be rendered as text" in there as well!

Re: Cool HTML elements nobody uses

#50

My favorite (non-conforming, do-not-use) element is . It switches the browser's parsing context to "generic raw text"; it emits any "child" markup as-is, without parsing it. [0] https://jsfiddle.net/spdustin/y4m3qd71/1/

is also fun. Unlike you can't get out of it with a closing tag.

Aside: plaintext is one reason browser DOM is a superset of HTML. By which I mean you can add to the middle of your DOM through JavaScript and everything is hunky-dory, but it's impossible to serialize the DOM to HTML so it'll HTML-parse back to the same DOM (at least if the serializer doesn't produce any JavaScript).

Post reply on HN