HTML reference
html
The <html> element is the root of an HTML document. Every other HTML element belongs inside it, usually split into <head> and <body>.
What you will learn
- Why
<html>is the document root - What the
langanddirattributes do - How
headandbodyfit inside it
Basic structure
<!doctype html>
<html lang="en">
<head>
<title>Page title</title>
</head>
<body>
<h1>Visible content</h1>
</body>
</html>
Useful attributes
lang- Declares the main language of the document, such as
enorja. This helps screen readers and other tools choose pronunciation and language rules. dir- Sets text direction:
ltr,rtl, orauto. It is useful for right-to-left languages.
Remember
Put metadata in <head> and visible page content in <body>. Set an accurate lang value instead of leaving the document language unknown.