VOOZH about

URL: https://www.geeksforgeeks.org/css/css-lang-selector/

⇱ CSS :lang Selector - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

CSS :lang Selector

Last Updated : 29 Aug, 2024

The :lang Selector is used to target the element which is based on language attributes for a specific value. This selector work with the help of language-code. 

Syntax:

:lang(lang-code) {
//property
}

Language Codes:

  • en: for English.
  • hi: for Hindi.
  • fr: for French.
  • de: for German
  • it: for Italian
  • ca: for Canadian

Example-1:

Output:

👁 Image
Example-2: Language code apply on root element. 

Output:

👁 Image

Supported Browsers:

  • Google Chrome 1.0
  • Edge 12.0
  • Firefox 1.0
  • Safari 3.1
  • Opera 8.0
Comment
Article Tags: