LESSON 86 OF 120

Repair: document language and direction

Declare Romanian and left-to-right direction on html.

Official sourceWHATWG HTML — langReviewed: 2026-08-26
STEP 1 · LEARN

How it works

Declare Romanian and left-to-right direction on html. Semantic structure should describe meaning, not visual appearance.

Correct example
<!doctype html>
<html lang="ro" dir="ltr">
<head><title>Bun venit</title></head>
<body><h1>Bun venit</h1></body>
</html>

lang="ro" declares Romanian as the document’s primary language and helps technologies such as speech synthesis and translation. dir="ltr" declares the left-to-right base direction. On html, both apply to the whole document.

Common mistake
<html lang="" dir=""><body><h1>Bun venit</h1></body></html>

The attributes are present, but empty values identify neither the document language nor its direction.

STEP 2 · APPLY

Your exercise

Repair the example without changing its purpose. Declare Romanian and left-to-right direction on html.

STEP 3 · BUILD

Write and see the result

index.htmlHTML
Safe resultisolated
The draft stays only in this browser.HTML and CSS allowed · scripts and network blocked
STEP 4 · CHECK

What needs to pass

0%not checked
  • html has lang="ro" and dir="ltr".
  • The document keeps a visible heading.
Explain the solution logic

Complete the opening tag as <html lang="ro" dir="ltr"> and do not remove the h1 from body.