Languages
[Edit]
EN

CSS - style HTML elements depending on content language

3 points
Created by:
Fletcher-Peralta
778

In this article, we would like to show you how to style HTML elements depending on content language in CSS.

Quick solution:

Note:

The div element can be replaced with any other selector or use * to style all elements (e.g. *:lang(en-US)).

 

Practical example

Edit

In this example, we create styles for div elements with three different languages using :lang() pseudo class.

 

References

Edit
  1. :lang() - CSS: Cascading Style Sheets | MDN
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join