Writing "<download>", with the word in angle brackets, makes it look like an element but it's not, download is an element attribute.
Writing "<download>", with the word in angle brackets, makes it look like an element but it's not, download is an element attribute.
I am aware of the distinction, I only used that way b/c HN doesn't really have a good way to indicate code without multiple spaces or just blindly using the ` character which is...not great.
How to use <cite> is often misunderstood. Many think it can be used to identify the author of a quotation but it should only be used to name the work a quotation is from. Standard Ebook placed it inside the <blockquote> but I've also seen it placed after <blockquote>, I don't know whether both are considered correct or if it's a point of disagreement; to me, <blockquote> should contain only the quoted material itself but I understand the appeal of having the quote and its source be neatly contained within one semantic element.
Using the Markdown convention of putting backticks around `code` may not be great but at least it won't be confused for the wrong actual code.
I believe our use of <cite> predates the modern definition of its use, and in any case it's so infrequently found in a web context that I don't think there's much agreement about how it should be used anyway. (For example MDN says the work title must be in <cite>, but at SE we often only include an author name, like <cite>--Shakespeare</cite>.)
[0] https://en.wikipedia.org/wiki/HTML5#W3C_and_WHATWG_conflict
I recall in a (lost) blog theme I had at one point in time I'd scrounged a nice bit of CSS to add cite attributes visibly appended to blockquote and q elements. Exposing it to the user is possible in just pure CSS, but it is a bit of a shame that browsers didn't style it by default so many people didn't learn it was a thing.
<q cite="https://www.w3.org/Consortium/">To lead the
World Wide Web to its full potential by developing protocols and
guidelines that ensure long-term growth for the Web</q>
q::after {
content: attr(cite);
}
That will show the source URL for a quote but it's not very useful, the URL isn't clickable (unless you wrap the whole <q> in a link), it's not even selectable text.Not selectable is still a bit annoying in that case, but Author Names don't need to be clickable links and the point comes across.
It used to be the case that the values of `content` properties weren't read by screen readers so this technique would mean the information was solely conveyed visually, that blind screen reader users wouldn't get it, but screen readers have been reading `content` properties for a while.
In any case, if the citation is important information to convey, it should probably exist at a text node in the document, not as metadata that gets pulled out and displayed by the styling.
[0] https://html.spec.whatwg.org/multipage/indices.html#attribut...
blockquote::after, q::after {
content: " - " attr(cite);
display: block;
font-style: italic;
}
Should do the trick nicely.