CSS Language Pseudo-Class

« Previous Tutorial Next Tutorial »

The language category of pseudo-class includes one class only, that is, :lang.

The :lang pseudo-class is used to specify a language to be used in a specific element. It is used in an HTML document that uses different language.

CSS :lang Pseudo-class Example

Let's look at the following example, where the :lang class defines the quotation marks for <q> elements with lang="no":

<!DOCTYPE html>
   <title>CSS Language Pseudo Class Example</title>
      q:lang(no) { quotes: "~" "~"; }

<p>This is a <q lang="no">first sentence of first paragraph.</q>. 
This is <q lang="no">second sentence of first paragraph.</q></p>


Here is the sample output produced by the above CSS language pseudo-class example code:

css language pseudo class example

In the above example, the :lang defines the quotation marks for q elements with lang="no"

CSS Online Test

« Previous Tutorial Next Tutorial »

© Copyright 2021. All Rights Reserved.