CSS3 > Selectors

Language selector in CSS3

How to select the elements with a lang attribute in CSS3?

By using lang selector we can select the elements with a lang attribute. The lang attribute value is mostly a two-letter language code like ('fr' for french, 'ar' for arab, etc...).

        div:lang(bn) {
            color: blue;
            background-color: pink;

    <p>Welcome to Bengal</p>
    <div lang="bn">Banlaya sbagatama</div>
    <p>"Banlaya sbagatama" means 'welcome to Bengal' in Bengali language.</p>

In the above code snippet in lang selector is used to present the text "Welcome to Bengal" on webpage in Bengali language.


 Views: 4427 | Post Order: 26

Write for us

Hosting Recommendations