Friday, 16 December 2011

using cite in blockquote

The blockquote tag has had a cite property for quite a while.

Unfortunately this is not used.
An improvement is to append it at the end of the blockquote by using the ::after selector:

blockquote[cite]::after {
 content: "source: " attr(cite);
 display: block;
 border-top: solid 1px grey;
 margin-top: 1em;
 text-align: center;
}

And we get something like so:
If the cite attribute is present, it must be a valid URL
potentially surrounded by spaces.

Unfortunately this generated text cannot be selected in Firefox, it is a long-standing bug.
It can be selected in Opera.
It cannot be selected in Chrome.

... IE9? Doesn't even generate the content.

No comments:

Post a Comment