Skip to main content

Day 71 of 100DaysOfSpec, cite, q, and dfn elements

I am reading and taking notes on the HTML specifications for 100 days as part of #The100DayProject. Read the initial intent/backstory. I am a Microsoft employee but all opinions, comments, etc on this site are my own. I do not speak on behalf of my employer, and thus no comments should be taken as representative of Microsoft's official opinion of the spec. Subsections not listed below were read without comment.

Currently reading in 4.5 Text-level semantics.

UAs = user agents = browsers and other HTML document parsers/renderers

4.5.6 The cite element

“The cite element represents a reference to a creative work. It must include the title of the work or the name of the author (person, people or organization) or an URL reference…”

  • No need to take such a literal tack with “creative”: pretty much any body of text created by a human being will do.
  • What might be unclear from the definition of cite is that it doesn’t contain the text content of the reference itself, just the title/name of where you got it from.

4.5.7 The q element

“The q element represents some phrasing content quoted from another source.”

  • The UA inserts the quotation marks, so you shouldn’t add them yourself.
  • Attributes include your standard global attributes, as well as cite, which is a link out (valid URL) to the original source or more information.
  • The q element and plain text contained in quotations are equally semantic/valid ways of marking up a quotation from another source.

4.5.8 The dfn element

“The dfn element represents the defining instance of a term.”

  • The definition that matches the term in the dfn needs to be included in the nearest paragraph / description list group / section ancestor.
  • What term exactly is being defined:
    1. title attribute, if set on the dfn element, otherwise…
    2. …if there is only one child element (including loose text), that is, an abbr with a title attribute, the term is that abbr’s title, otherwise…
    3. …it’s the text content of the dfn element.
  • The title attribute on the dfn contains ONLY the term being defined.
  • dfn does not inherit title for use in this way.
  • “An a element that links to a dfn element represents an instance of the term defined by the dfn element.”

Responses

My blog uses Webmentions. Responses from sites which likewise support Webmentions, such as Twitter or people’s personal sites, will show up here.

No Webmentions have been sent to this post yet.