4 ms·
Yes, you could do something like this: <q cite="https://www.w3.org/Consortium/">To lead the World Wide Web to its full potential by developing protocols an
by extra88 5y ago
Yes, you could do something like this:
<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.
- WorldMaker 5y agoWhile the semantic web mindset (especially the "Xanadu" inspired subsets) thought cite should always be a URL, it didn't technically have to be per the spec. (Without browser behavior backing it as a URL, it certainly didn't have any enforcement to be a URL.) In my case I think I was using it for author annotations in a more "APA or Chicago Style Manual" style at the time I had CSS like that in the style of: —Author Name from "Book/Webpage Title" 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.
- extra88 5y agoThe current HTML spec says a cite attribute's value has to be a valid URL [0]. I don't know if that's a point at which the WHATWG and W3C versions differed, like on the <cite> element. I do think it came from a semantic web mindset, that the attribute isn't really for the user, it's for programmatic use by the web host, like a CMS, or other systems. 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#attributes-3 https://html.spec.whatwg.org/multipage/indices.html#attribut...