Computer >> Computer tutorials >  >> Programming >> HTML

How to specify the language of the element's content in HTML?


Use the lang attribute to specify the language of the element’s content in HTML. You can try to run the following code to implement the lang attribute − 

Example

Here, we have added content in French and Spanish as well.

<!DOCTYPE html>
<html>
   <body>
      <h2>English</h2>
      <p lang = "en">This is demo text</p>

      <h2>French</h2>
      <p lang = "fr">Ceci est un texte de démonstration</p>

      <h2>Spanish</h2>
      <p lang = "es">Este es un texto de demostración</p>

   </body>
</html>