If I have a quote like the following on my web page:
"I think, therefore I am"
-Rene Descartes
What would be the proper HTML5 tags to represent that quote and its author? And how would they be structured correctly?
If I have a quote like the following on my web page:
"I think, therefore I am"
-Rene Descartes
What would be the proper HTML5 tags to represent that quote and its author? And how would they be structured correctly?
You don't layout a citation too differently in HTML5 than you do in XHTML or HTML4. The basic structure would be this:
The only thing different that we see is the use of the tag
<footer>
that did not exist before HTML5, it is not mandatory to use it but since the author is on a separate line it is semantically the best option.The attribute
cite
(which would be a URL pointing to the source of the citation) could also be added to the<blockquote>
, as well as a link in the tag<cite>
that leads to a page about the author or the work, as the case may be.A point of debate that there was in its day was that at first in HTML5 the tag
<cite>
was only for the title of the work but in subsequent revisions of the specification that changed and the possibility of putting the name of the author was added, as had been done forever.Link to the tag
<blockquote>
in the HTML5 specification: https://www.w3.org/TR/html5/grouping-content.html#the-blockquote-elementPS: Perhaps you have also seen it used
<cite>
for the quote itself but it is not the correct way to do it, the function<cite>
has always been to attribute authorship, the tags for the quote are<blockquote>
as a block element and<q>
as an inline element.