
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
HTML lang Attribute
The HTML lang attribute define the language of the HTML element’s content. It is a global attribute that means it can be used on any HTML element.
Syntax
Following is the syntax −
<tagname lang=”value”></tagname>
Here, value represent ISO language code.
Let us see an example of HTML lang Attribute −
Example
<!DOCTYPE html> <html> <style> body { color: #000; height: 100vh; background-color: #8BC6EC; background-image: linear-gradient(135deg, #8BC6EC 0%, #9599E2 100%); text-align: center; } </style> <body> <h1>HTML lang Attribute Demo</h1> <p lang="en">This is a paragraph element with some dummy text and lang attribute.</p> </body> </html>
Output
- Related Articles
- HTML DOM lang Property
- Style every element with a lang attribute value with CSS
- Selects all elements with a lang attribute value starting with "en" with CSS
- HTML maxlength Attribute
- HTML wrap Attribute
- HTML checked Attribute
- HTML datetime Attribute
- HTML value Attribute
- HTML coords Attribute
- HTML hreflang Attribute
- HTML cite Attribute
- HTML cite Attribute
- HTML autocomplete Attribute
- HTML max Attribute
- HTML placeholder Attribute

Advertisements