

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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>
- Related Questions & Answers
- How to specify whether the content of an element should be translated or not in HTML?
- How to specify the HTML content of the page to show in the <iframe> in HTML?
- How to specify that the styles only apply to this element's parent element and that element's child elements in HTML?
- How to add multi-language content in HTML?
- How to specify that the element is read-only in HTML?
- How to specify the type of box used for an HTML element using CSS?
- How to specify the usage of an element using the tabbing order (tab keyboard button) in HTML?
- How to specify the kind of text track in HTML?
- How to get HTML content of an element using jQuery?
- How to set HTML content of an element using jQuery?
- How to specify the URL of the page the link goes to in HTML?
- Execute a script when the content of the element is being cut in HTML?
- Execute a script when the content of the element is being copied in HTML?
- How to print the content into the files using C language?
- How to specify that the element should automatically get focus when the page loads in HTML?
Advertisements