Accesskey n skips to in-page navigation. Skip to the content start.

s_gotoW3cHome Internationalization
 

Test results: Language-dependent styling

These tests check whether CSS language selectors work for styling text in HTML.

The tests check expected behavior against the HTML 4.01 spec.

Summary & conclusions

See the results below for user agents tested. This section summarizes the results of those tests.

All browsers support lang|= and lang= selectors as expected, except for a bug in IE7 and IE8beta where az-Arab-IR is not matched against az-arab-IR.

All browsers except IE7 support :lang as expected. IE7 does not support :lang at all, but IE8beta does.

No browser matches collapsed script subtags between language and region subtags.

No browser picks up on CSS selectors using the xml:lang (rather than lang) attribute.

Latest results

These are results for the latest versions of each browser tested. Green (yes) means passed, Ochre (part) means partial pass, Red (no) means fail. Yellow (true) means that a non-normative test was answered in the affirmative, and Grey (false) means the opposite. Numbers in the table relate to notes immediately below.

:lang

UA IE Firefox Opera Safari IE
version 7 3.0.1 9.51 3.1.2 8 Beta
OS XP XP XP XP XP
date 20080718 20080718 20080718 20080718 20080718
1 :lang(es), lang="es" no yes yes yes yes
2 :lang(es), lang="es-MX" no yes yes yes yes
3 :lang(es), lang="ES" no yes yes yes yes
4 :lang(es), lang="mx-es" yes yes yes yes yes
5 :lang(en-GB), lang="en-GB" no yes yes yes yes
6 :lang(en-GB), lang="en-GB-scouse" no yes yes yes yes
7 :lang(en-GB), lang="en-US" yes yes yes yes yes
8 :lang(en-GB), lang="en" yes yes yes yes yes
9 :lang(az-Arab-IR), lang="az-Arab-IR" no yes yes yes yes
10 :lang(az-Arab-IR), lang="az-IR" yes yes yes yes yes
11 :lang(cs-CZ), lang="cs-Latn-CZ" yes yes yes yes yes
12 :lang(az-Arab-IR), lang="az-arab-IR" no yes yes yes yes
13 Inheritance by inline elements no yes yes yes yes
14 Inheritance from an ancestor, block elements no yes yes yes yes
15 Inheritance from an ancestor, inline elements no yes yes yes yes
16 xml:lang in HTML yes yes yes yes yes

lang |=

UA IE Firefox Opera Safari IE
version 7 3.0.1 9.51 3.1.2 8 Beta
OS XP XP XP XP XP
date 20080718 20080718 20080718 20080718 20080718
1 :lang(es), lang="es" yes yes yes yes yes
2 :lang(es), lang="es-MX" yes yes yes yes yes
3 :lang(es), lang="ES" yes yes yes yes yes
4 :lang(es), lang="mx-es" yes yes yes yes yes
5 :lang(en-GB), lang="en-GB" yes yes yes yes yes
6 :lang(en-GB), lang="en-GB-scouse" yes yes yes yes yes
7 :lang(en-GB), lang="en-US" yes yes yes yes yes
8 :lang(en-GB), lang="en" yes yes yes yes yes
9 :lang(az-Arab-IR), lang="az-Arab-IR" yes yes yes yes yes
10 :lang(az-Arab-IR), lang="az-IR" yes yes yes yes yes
11 :lang(cs-CZ), lang="cs-Latn-CZ" yes yes yes yes yes
12 :lang(az-Arab-IR), lang="az-arab-IR" no 1 yes yes yes no 1
13 Inheritance by inline elements yes yes yes yes yes
14 Inheritance from an ancestor, block elements yes yes yes yes yes
15 Inheritance from an ancestor, inline elements yes yes yes yes yes
16 xml:lang in HTML yes yes yes yes yes

Notes:

  1. IE7: Note that this contrasts with test #3.

lang=

UA IE Firefox Opera Safari IE
version 7 3.0.1 9.51 3.1.2 8 Beta
OS XP XP XP XP XP
date 20080718 20080718 20080718 20080718 20080718
1 :lang(es), lang="es" yes yes yes yes yes
2 :lang(es), lang="es-MX" yes yes yes yes yes
3 :lang(es), lang="ES" yes yes yes yes yes
4 :lang(es), lang="mx-es" yes yes yes yes yes
5 :lang(en-GB), lang="en-GB" yes yes yes yes yes
6 :lang(en-GB), lang="en-GB-scouse" yes yes yes yes yes
7 :lang(en-GB), lang="en-US" yes yes yes yes yes
8 :lang(en-GB), lang="en" yes yes yes yes yes
9 :lang(az-Arab-IR), lang="az-Arab-IR" yes yes yes yes yes
10 :lang(az-Arab-IR), lang="az-IR" yes yes yes yes yes
11 :lang(cs-CZ), lang="cs-Latn-CZ" yes yes yes yes yes
12 :lang(az-Arab-IR), lang="az-arab-IR" no 1 yes yes yes no 1
13 Inheritance by inline elements yes yes yes yes yes
14 Inheritance from an ancestor, block elements yes yes yes yes yes
15 Inheritance from an ancestor, inline elements yes yes yes yes yes
16 xml:lang in HTML yes yes yes yes yes

Notes:

  1. IE7: Note that this contrasts with test #3.

Tell us what you think (English).

Subscribe to an RSS feed.

New resources

Home page news

Further reading

Author: Richard Ishida, W3C.

Valid XHTML 1.0!
Valid CSS!
Encoded in UTF-8!

Content first published 2005-08-03. Last substantive update 2008-07-18 14:10 GMT. This version 2008-07-18 14:10 GMT

For the history of document changes, search for results-css-lang in the i18n blog.