I’m picky about pullquotes

No, really.

In a magazine, a pullquote can pull a browsing reader into an article by highlighting a provocative comment or deft turn of phrase, or help steel a reader’s resolve to press on, teasing them with a little deferred gratification. That magazine-ey feel can be helpful on sites with long, multi-page articles that are otherwise relatively unbroken by pictures, blockquotes, or other places for the eye to rest.

There are many examples of pullquotes on the web. But each fails to satisfy in some way.

Many authors add the content of the pullquote to the document , unnecessarily repeating content or interrupting the HTML stream with a non-sequitur. This could have a jarring effect on a reader browsing without benefit of CSS, or using a screen reader (unless the CSS rule speak: none were used by the author and supported by the reader).

Many go a step further, identifying content that would make a nice pullquote, wrapping it in a span and using JavaScript to replicate it in the DOM. Roger Johansson’s technique is the definitive example of this method. This is great because we do not have excess content for what is essentially a presentational effect. It does put the pullquote right next to its source text, though, which is unfortunate.

Also, the above method requires your pullquote to be a direct quote of the source text. Pullquote text often does not exactly match its source. Dependent clauses are trimmed, prepositions adjusted, other editing is done to allow the pullquote to stand alone. This requirement led me to toy with the notion of using JavaScript to collect one or more spans selected from the text into a single pullquote, but I stopped when I realized that that would only allow me to drop words from the source text, not change them if necessary.

So far we’ve identified the following requirements:

  1. No repeated or extra content
  2. Control over pullquote placement in source text
  3. Pullquote text not necessarily a direct copy of source text

If we relax the first requirement slightly, this can be done. We might add an empty span to our HTML where we want the pullquote to appear, and place the content for the pullquote in its title attribute. We then use some JavaScript to find this empty span and put its title text inside. A little CSS makes it pretty. I’ve made an example page with very simple code so the effect is obvious.

3 comments

  1. I’m curious as to whether you could better isolate the pullquote span to be independent of the main content of the document? Looking at it from a translation perspective, the pullquote content could break the context of the paragraph and possibly affect the resulting translation.

    What if you were to use two spans? One for the pullquote content and another as a placeholder for placement of that content.

    Or maybe something else?

  2. Ah, translation. Sure, in WorldServer the title attribute content would show up between potentially unrelated sentences, causing a non-sequitur for the translators. One possibility would be to have spans containing all of the pullquote content collected at the end of the document (the translator will have read and ostensibly understood the entire body of the document at that point) with somehow-related target spans within the doc acting as little sockets in which to fit the content. AppendChild() the content-laden span to the target span in the body of the doc, and voila! This would allow a diversity of inline content as well, rather than restricting you to whatever you can cram into a title attribute.

    Other options include pulling in what amounts to a resource bundle via JSON (which moves the content out of the document, not so good) or putting the spans between paragraphs and using a little negative margin or positioning to drag them around (in ems, of course).

    (Note to self: style the comments and comment form, already!)

  3. Another possible benefit of placing them after the main content is that translators / editors will have already read the passages and be in better position to tweak the pullquote as necessary.

Leave a comment