Preparing your workspace
A valid HTML document has a clear structure. The document contains metadata in the head and visible page content in the body.
The <!DOCTYPE html> declaration tells the browser to use modern HTML standards mode. The html element is the root of the document. The head contains information about the page that is generally not displayed as normal page content, such as the title, character encoding, viewport settings, stylesheets, and other metadata. The body contains the content users see and interact with. The title element defines the browser tab title and is also important for search engines. The meta charset declaration tells the browser how text should be interpreted. The viewport meta tag helps responsive pages behave correctly on mobile devices.
Every production website needs a document structure so the browser can correctly understand metadata, visible content, encoding, and responsive behavior.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Study Portal</title>
</head>
<body>
<h1>HTML Course</h1>
<p>Learn HTML step by step.</p>
</body>
</html>The browser shows 'HTML Course' as the main heading and 'Study Portal' as the browser tab title.