:lang() - HTML CSS CSS Selector

HTML CSS examples for CSS Selector:lang

Description

The :lang() selector selects elements by the lang attribute.

Example

Select every <p> element with a lang attribute value equal to "it" (Italian):

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<style>
p:lang(it) {<!--from ww  w  .j a v a2s . c  om-->
    background: yellow;
}
</style>
</head>
<body>

<p>I live in Italy.</p>
<p lang="it">Ciao bella!</p>

</body>
</html>

Related Tutorials