printing acronyms
While trying to fit a giant title into a two lines area, converting what could be converted to acronyms, I wondered how I could expand said acronyms in the printed version of the page.
I also wondered why Gecko bothered to print a dotted border-bottom on acronyms: after all, on a sheet of paper they aren’t quite hoverable, so the dotted line is just distracting.
So anyway, here’s what one could use to print an acronym:
acronym[title]:after {
content: "\0000a0(" attr(title) ")";
}
acronym {
border-bottom: 0;
}
Problem: Typography dictates that only the first instance of an acronym be expanded. To comply, one would have to change acronym[title] to acronym.first[title], and then add class=”first” to the first instance of the acronym.
Half-assed workaround: CSS3 provides a :first-of-type pseudo class that applies to sibling tags. Once it’s implemented in browsers, it could be used to expand the first acronym in each container. That’s a good enough solution if one doesn’t want to pollute markup with extra classes.