Search the Whole World Here.,.,

The lang Attribute

The lang Attribute

The lang Attribute

The language of the document can be declared in the  tag.
The language is declared with the lang attribute.
Declaring a language is important for accessibility applications (screen readers) and search engines:
<!DOCTYPE html>
<html lang="en-US">
<body>

...

</body>
</html>
The first two letters specify the language (en). If there is a dialect, use two more letters (US).

HTML Attributes

HTML Attributes

Attributes provide additional information about HTML elements.

HTML Attributes

  • All HTML elements can have attributes
  • Attributes provide additional information about an element
  • Attributes are always specified in the start tag
  • Attributes usually come in name/value pairs like: name="value"

Empty HTML Elements

Empty HTML Elements

Empty HTML Elements

HTML elements with no content are called empty elements.

is an empty element without a closing tag (the
tag defines a line break).
Empty elements can be "closed" in the opening tag like this:
.
HTML5 does not require empty elements to be closed. But if you want stricter validation, or if you need to make your document readable by XML parsers, you must close all HTML elements properly.

Ads by Google