The :lang() selector and font-size in %

Dear Richard, all

Presentation styles are commonly used to control changes in fonts, font 
sizes etc. when language changes occur in the document.
In "Styling using language attributes" 
( the first 

em           { font-style: italic; }
em:lang(ja)  { font-style: normal; font-emphasize: dot before; }

<p>This is <em>English</em>, but <span lang="ja">これは<em>日本語</em>で 

shows the advantage of :lang() vs *[lang=".."].

But the :lang() selector has also a disadvantage against *[lang=".."]. 
In the following (similar) example:

:lang(fr) { font-style: italic; font-size:130%; }

<p>This is <em>English</em>, but <span lang="fr">ceci est 
<em>Français</em>, non?</span></p>

the word Français will be italicized, OK, but amplified 130% twice! (And 
as much as there are nested elements. Imagine <em><a 
...>Français</a></em>). Here, *[lang="fr"] selector would be more 

I think the article above should also mention this point, because 
styling to accommodate language change is mainly about font-size.

I often use the lang attribute in styling to better harmonize the look 
(font-size) when some Arabic and Latin fonts are mixed. My preferred 
Arabic fonts ("Al Bayan" or "Traditional Arabic") look smaller.



Najib TOUNSI (tounsi at
W3C Office in Morocco (
Ecole Mohammadia d'Ingénieurs, BP. 765 Agdal-RABAT Morocco
Tel: +212 (0) 537 77.05.98 Mobile: +212 (0) 661 22 00 30

Received on Wednesday, 19 September 2012 13:29:01 UTC