IMG-LOGO

How to target language attribute selector in CSS?

andy - 30 Sep, 2019 2584 Views 0 Comment

If you want to target a language attribute selector in CSS, you can use the attribute lang.

For example, let says we want to target a div contains a language attribute of en-US. We want to change the font style of text to use italic style.

<div lang="en-US">
This div element tag contains English language.
</div>

Based on above example, we can use the following css code.

div[lang!="en"]{
   font-style:italic;
}

Comments

There are no comments available.

Write Comment
0 characters entered. Maximum characters allowed are 1000 characters.

Related Articles

How to draw a circle in CSS?

In this article, we are going to learn how to draw a circle in CSS. Firstly what needs to do is to create a CSS class called circle.

How to create rounded image using CSS3?

In this tutorial you will learn on how to create a rounded image in CSS3. We will use CSS property called border-radius to create this rounded image effect.