Non-breakable Space Story

I’m quite fond of this new fashion, that is, displaying the language of a page after the link. This can be done by using the content property generating, well, err… content in that manner:

a[hreflang]:after {
content:" ["attr(hreflang)"]"; 
}

What I was a bit frustrated by was that this text between brackets was sometimes sent back to a new line, which is, IMVHO, a bit of a disgrace, typographically speaking – or maybe it’s just another French national sport, caring for the line breaks. English-speaking people don’t even bother thinking of where to hyphen a word.

Browsing through the W3C recommandation, I found out that you were allowed to put Unicode-coded escape sequences. That just suited my needs; my code looks now something like:

a[hreflang]:after {
content:"A0["attr(hreflang)"]"; 
}

As far as I can see, it works just fine. With Mozilla, that is.

 
---

Commenting is closed for this article.

---