0% found this document useful (0 votes)
15 views

HTML Lang : !doctype HTML Body h1 /h1 P /P /body /HTML

HTML elements can contain attributes that provide additional information about an element. Attributes are specified in name/value pairs within an element's start tag. The lang attribute can declare the language of a document in the <html> tag using a two letter language code and optional two letter country/region code. The title attribute can provide a descriptive title for an element like a <p> paragraph.

Uploaded by

Bogdan Chindris
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

HTML Lang : !doctype HTML Body h1 /h1 P /P /body /HTML

HTML elements can contain attributes that provide additional information about an element. Attributes are specified in name/value pairs within an element's start tag. The lang attribute can declare the language of a document in the <html> tag using a two letter language code and optional two letter country/region code. The title attribute can provide a descriptive title for an element like a <p> paragraph.

Uploaded by

Bogdan Chindris
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

HTML Attributes

HTML elements can have attributes


Attributes provide additional information about an element
Attributes are always specified in the start tag
Attributes come in name/value pairs like: name="value"

The lang Attribute


The document language can be declared in the <html> tag.
The language is declared in the lang attribute.
Declaring a language is important for accessibility applications (screen readers) and search
engines:
<!DOCTYPE html>
<html lang="en-US">
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
The first two letters specify the language (en). If there is a dialect, use two more letters (US).
The title Attribute
HTML paragraphs are defined with the <p> tag.
In this example, the <p> element has a title attribute. The value of the attribute is "About
W3Schools":
<p title="About W3Schools">
W3Schools is a web developer's site.
It provides tutorials and references covering
many aspects of web programming,
including HTML, CSS, JavaScript, XML, SQL, PHP, ASP, etc.
</p>

You might also like