There's also a SQLite DB available to download of the top 1k tag+attr+value combinations. [2]
[1] https://webparsing.io/blog/hidden-in-html-parsing-page-layou... [2] https://webparsing.io/data/commoncrawl-2024-11-html-tags-att...
It's fun to compare it to "A blog post with every HTML element" [1][2], which gets at a (very!) similar thing but in a very different way. This post primary shows, and is a little more chaotic (meant positively!) whereas the other post is much more prose and explanation heavy (also good, but very different).
[1] https://www.patrickweaver.net/blog/a-blog-post-with-every-ht...
[2] HN discussion: https://news.ycombinator.com/item?id=37104742
From your website it looks like we're in the same city; feel free to shoot me an email (mine is in my profile) if you'd like to grab coffee sometime :)
Whats the advantage of creating a separate `label` element before/after the input and using `for=` compared to simply wrapping the target input in the label element, like the code snippet below?
<label>
Your Name?
<input />
</label>
It seems to me that there is a lot less room for error when not using IDs, so I always wrap the input. My pages use a client-side webcomponent to inject fragments of HTML into the page (navbar, footer, etc), and using IDs almost always cause conflicts in the end, so I avoid ID attributes in all but a few very rare instances.https://developer.mozilla.org/en-US/docs/Web/API/Popover_API...
The usual handling is with the JS API, but it's possible to handle it with CSS only. For instance, display the modal window only if a checkbox is checked.
The tag leads the parser to interpret everything following it as character data, but doesn’t impact rendering. In these cases, if there are active formatting elements that would normally be reconstructed, they will after the PLAINTEXT tag as well. It’s quite unexpected.
<a href="https://news.ycombinator.com"><b><i><u><s><plaintext>hi
In this example “hi” will render with every one of the preceding formats applied.https://software.hixie.ch/utilities/js/live-dom-viewer/?%3Ca...
After I discovered this the note in the spec was updated to make it clearer.
https://html.spec.whatwg.org/multipage/parsing.html#:~:text=A start tag whose tag name is "plaintext""please accept from me this unpretentious bouquet of early-blooming" <plaintext>s
https://datatracker.ietf.org/doc/html/draft-ietf-html-spec-0...
The PLAINTEXT element was replaced by the LISTING element (which was itself deprecated in HTML 3.2): https://datatracker.ietf.org/doc/html/rfc1866#section-5.5.2....
and looking up the <ruby> tag:
https://interactive-examples.mdn.mozilla.net/pages/tabbed/ru...
The <ruby> HTML element represents small annotations that are rendered above, below, or next to base text, usually used for showing the pronunciation of East Asian characters. It can also be used for annotating other kinds of text, but this usage is less common.
The term ruby originated as a unit of measurement used by typesetters, representing the smallest size that text can be printed on newsprint while remaining legible.
Also Oxygen was mentioned, but not Argon
It sometimes appears that the modern ideal is to not have an element "do" anything on it's own and depend on the css to define it's purpose. But we still have a lot of historical baggage we are carrying around.
I am so glad to see someone use "raises the question" correctly instead of using "begs the question" which does not mean "raise the question".
In response to your question - you'd be surprised if you have a few (3-4) webcomponents for the most common needs in front-end; things like client-side includes, etc.
In fact, with just client-side includes you get 50% of what a front-end framework gives you (ability to create reusable and standalone components).
Of course then you spend the time you won in ditching the framework to figure out ways to pierce the shadowroot so you can apply your global styles to the component :-(
Ask me how I know.
I think a more accurate word here would be "prescient".
"Omniscient" means knowing everything, but I believe that "everything" doesn't include "everything now and in the future.
"Prescient" means knowing future events, i.e. "predicting"
(Emphasis mine)
For example, there are elements like nextid or isindex which don’t have element definitions but which appear in the parsing rules for legacy compatibility. These are necessary to avoid certain security issues, but the elements should not be used and in a sense don’t exist even though they are practically cemented into HTML forever.
<center>alignment with no CSS</center>Similar to:
https://no-gravity.github.io/html-quine/index.html
Could be tricky, because non-textual elements would probably have to be taken care of individually. For example a video would probably have to show a video of its own representation in code.
btw it really drives me crazy that browser implementors think that when I copy/paste a numbered list, I somehow don't want the numbers.
Subheadings are one of those little things I've wondered about the proper semantics for a million times and always end up doing something slightly different on the fly.
<hgroup> was officially added to the HTML spec in 2018 [1]
It was deprecated in the W3C spec but not from the WHATWG spec, before they were merged.
In a nutshell, hgroup was originally criticized and rejected when W3C was still redacting HTML specs received from the loose group of browser devs and other people calling themselves "WHAT working group" because it paired headings of multiple ranks in a way that confused assistive technologies in browsers. But the first (and at the same time the last;) W3C HTML recommenndation created as unredacted WHAT WG spec snapshot under the W3C/WHATWG "memorandum of understanding" actually smuggled hgroup in. Then Steve Faulkner removed HTML outlining and the whole concept of sectioning roots that was part of Ian Hickson's vision of "HTML 5" for the longest time, but W3C never actually started a new recommendation process afterwards, and the charter for the HTML WG at W3C, Inc. has ended last year. See details at [1].
Arguably, with this change in 2023, we're now post-HTML5. But don't tell the people believing in a single "HTML 5 standard".
It was only deprecated in the W3C specification, not the WHATWG specification.
But now it's back in good standing: https://www.tpgi.com/subheadings-subtitles-alternative-title...
Perhaps it was re-added?
[1]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/po...
(And experimental)
The only use case I have for <div> is in a details/summary where there is no CSS to select the contents of a <details> element, excluding the <summary>.
Does this mean I use <section> instead of <div>, as a 'direct replacement'? Nope. When using CSS grid, there is no need for <div> wrappers around everything.
I do like to use the full HTML element set, and, with scoped CSS, to style the elements, rather than have loads of divs with loads of class attributes. It all looks so much neater, particularly if the unstyled CSS looks rather good.
<my-product>...</my-product>
Any tag with a hyphen is considered a custom element, which is completely valid HTML -- even without defining the element in JS.
This gives you a more descriptive `div`, and then instead of classes like `product-primary`, you can use semantic attributes, like `<my-product primary size="large">`. In combination with CSS nesting, you can get some great looking HTML and CSS with minimal markup/visual noise and no build step.
I quite like styling the attributes, which gets me half-way to what you describe. In ecommerce we have all kinds of extra attributes for marking up products, although you can ditch that and just have a chunk of JSON+LD these days.
What happens is that I end up with great document structure and human readable/writable HTML and no CSS preprocessor things needed. However, sometimes I have things such as lots of sections containing lots of articles that contain lots of sections. I might take your tip to write '<top-category>' for those top-level sections.
When styling the elements, you tend to use the full range of elements, so a list could be a <dl>, <ol> or <ul> even if it eventually just gets styled as an <ul>. Really, semantics needs to come first, even if the presentation is just normal stuff.
I keep finding code examples where people are doing more than just using divs, which means that I am feeling more confident flexing the whole HTML element LEGO set.
From a discussion on HN a few days ago, I bookmarked this: https://github.com/dbohdan/classless-css
For the most common types of front-end work one needs to do, classless CSS is enough.
div > *:not(summary)
If you can't do it, there is probably more work to do with your document structure. Also try and always have a h1-h6 heading in your articles, sections, asides and even navs, at the top. Headings should not be in a sea of paragraphs, they should be at the top of a content sectioning element, nowhere else.
That's XHTML which is XML. HTML does not use and does not need a closing slash and never has in any HTML specification.
https://html.spec.whatwg.org/dev/text-level-semantics.html#t...
HTML parsing at least is deterministic and fully specified, whereas XHTML, as an XML, leaves a number of syntax errors up to the parser and undefined.
Conforming software may detect and report an error and may recover from it.
While fatal errors should cause all parser to reject a document outright, this also leaves the end-user without any recovery of the information they care about. So XHTML leaves readers at a loss while failing to eliminating parsing ambiguity and undefined behavior.Interestingly, it’s possible to encode an invalid DOM with XHTML while it’s impossible to do so in HTML. That means that XML/XHTML has given up the possibility of invalid syntax (by acting like it doesn’t exist) for the sake of inviting invalid semantics.
[0] https://developer.mozilla.org/en-US/docs/Web/HTML/Element/de...
<progress value="70" onmousemove="value=Math.random()*100" max="100"/>Based on my tests just now, <blink> no longer blinks in today’s browsers but <marquee> still scrolls happily.
but hey, "use the platform"
Nice Work!