Live data from Hacker News

Every HTML Element

iamwillwang.com

21–30 of 136 posts

Re: Every HTML Element

#22
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 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.

Re: Every HTML Element

#23

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…

do you have an example?

Re: Every HTML Element

#25

First I've ever heard of hgroup. 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 is considered deprecated in HTML5 though, whatever that actually means.

Re: Every HTML Element

#28
post #23

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…

do you have an example?

Not to hand, for sharing here, but just try it with something like your CV, in neat HTML. Set yourself some rules to not use classes (for the lols, not out of ideological hatred) or divs (there is always a better element).

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.

Re: Every HTML Element

#30

I like that you included the tag! I really wish more pages would use them when rendering Chinese/Japanese characters in English text.

(your comment is very minimally informative, containing 1 bit of information: "there is something to learn about ruby". Searching "show source", "hidden gems" on OP's page marks the ruby spot)

and looking up the tag:

https://interactive-examples.mdn.mozilla.net/pages/tabbed/ru...

The 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.

Post reply on HN