codescracker


css

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>
<html>
<head>
	<title>CSS Language Pseudo Class Example</title>
	<style>
		q:lang(no) { quotes: "~" "~"; }
	</style>
</head>
<body>

<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>

</body>
</html>

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"


« Previous Tutorial Next Tutorial »



Tools
Calculator

Quick Links
Signup - Login - Give Online Test