Most people insist on only using one element, which is the element of last resort, according to MDN. This is our friend, the . The only use case I have for is in a details/summary where there is no CSS to select the contents of a element, excluding the . Does this mean I use instead of , as a 'direct replacement'? Nope. When using CSS grid, there is no need for wrappers around everything. I do like to use the full HT…
> The only use case I have for is in a details/summary where there is no CSS to select the contents of a element, excluding the . div > *:not(summary)
Every HTML Element
131–136 of 136 posts
Re: Every HTML Element
#132Earlier quoted context omitted.
> The only use case I have for is in a details/summary where there is no CSS to select the contents of a element, excluding the . div > *:not(summary)
This selects all the elements individually, so it behaves differently with attributes like margin or border.
Re: Every HTML Element
#133Re: Every HTML Element
#134For people interested in this sort of thing, I recently published a blog post looking at counts of HTML tags and their attribute values from a 2.9B page Common Crawl dataset. [1] 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...
Re: Every HTML Element
#135Re: Every HTML Element
#136Earlier quoted context omitted.
The story of XHTML is instructive to the field of software design. There are plenty of good resources on the web if you search why did XHTML fail ? 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 t…
Interesting perspective, it makes me miss XHTML wayyy less. I was under the impression that XHTML (XML) was better specified and had less weirdness. I know HTML is now better specified but some of the things inherited from HTML 4 and before make no sense to me (optional closing times SOMETIMES, optional stuff everywhere).
This, IMO, is a bigger reason to avoid regex and XML parsers for HTML documents. The rules aren’t apparent when thinking linearly about what strings appear after or before each other; they become clearer when thinking of HTML as a shorthand syntax for certain kinds of push and pop operations.
XHTML is easier to parse, but for well-formed documents pushes the complexity of invalid markup into the rendering side. For example, it’s well-formed to include a button inside a button, so XHTML browsers render exactly this, but it makes no sense from a UI perspective and strange things happen when invalid markup is sent in well-formed XML.