At 3/4/2007 11:17 PM, Chris Chen wrote: >I am help maintain a website that needs to support switching between >English and Chinese languages (preferrably just by clicking on a >button/link). Does CSS prescribe a recommended way to do such >language switching? > >Thanks, >Pai-Hung
I would say yes and no. CSS provides a language pseudo-class (:lang) for indicating the language of an expression, for example when mixing two languages together on the same page: CSS 2.1 Specification 5 Selectors 5.11.4 The language pseudo-class: :lang http://www.w3.org/TR/CSS21/selector.html#lang However, the only behavior that CSS really supports for content switching is hover (known in javascript as mouseover). In order to get content to change on click you need either server-side scripting or client-side scripting or both. Here's an example of one technique that I produced using English & Japanese text: http://laurietobyedison.com/WOJwords.asp?lang=EN Every bilingual page on the site contains both languages, with only one of them displayed at a time. In the absence of javascript, the Japanese/English toggle requests the current page from the server with the requested language selected (by specifying it in the body class). With javascript enabled, the language toggle simply switches the body class and the displayed language changes immediately. Regards, Paul __________________________ Paul Novitski Juniper Webcraft Ltd. http://juniperwebcraft.com ______________________________________________________________________ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d IE7 information -- http://css-discuss.incutio.com/?page=IE7 List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/