• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

7.4. lang Pseudo-Class

The lang pseudo-class sets the language associated with a particular Web element. A good example of where this can be put to use is in setting the type of quote marks that should appear in pages, such as those typified by Listing 7.2. While in English you can expect double- and single-quote characters, other languages have different ways of displaying quoted text. For example, the following code could be used to dynamically set the type of quote that should appear given the language of the text.

<style>
q:lang(en) {quotes: '"' '"'}
q:lang(FR) {quotes: '«' '»'}
q:lang(DE) {quotes: '»' '«'}
</style>


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint