Given HTML that looks like this:
<td class="n">1234.56</td>
I would like, using only CSS (without having to use, say, a <span> element in the HTML), to format the number with the last two digits (or, in general, characters) diminished in size.
My goal is to write a CSS stylesheet rule for the unadorned HTML above that behaves as if I had this:
<style>
.diminish { font-size: 50% }
</style>
<td class="number">1234.<span class="diminish">56</span></td>
:beforeor:afterto manipulate it but I am sure you have different content::beforeand::afterinsert a fake element before and after the current one, so it wouldn't select the digits which are part of the element. The only CSS selector which can select characters is ::first-letter which selects the first letter of a paragraph. You have no choice but to edit the html, sorry.:afterpseudo element with the same technique