BeginnerLesson 1 of 15
HTML Skeleton & Text – HTML & CSS
Document structure, headings, paragraphs, links, images and lists.
Every HTML document consists of elements with a start tag, content and an end tag (<p>Text</p>). Elements can have attributes (<a href="...">). The skeleton: <!DOCTYPE html> switches on standards mode, <html lang="en"> names the language, <head> contains invisible metadata, <body> the visible content.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>My First Page</title>
</head>
<body>
<h1>Hello Web!</h1>
<p>This is <strong>important</strong> and <em>emphasized</em> text.</p>
<p>Line one<br>Line two</p>
<hr>
<p>More info at <a href="https://developer.mozilla.org" target="_blank" rel="noopener">MDN</a>.</p>
</body>
</html>Headings go from <h1> (most important, usually once per page) to <h6> and form the outline – choose them by meaning, not by font size. You embed images with <img>; the alt attribute is mandatory (replacement text for screen readers and for when the image does not load). Lists: <ul> (bulleted), <ol> (numbered), <li> (item).
<!DOCTYPE html>
<style>body{font:16px system-ui,sans-serif;margin:12px;background:#fff;color:#222}</style>
<h2>Ingredients</h2>
<img alt="Red circle as a sample image" width="80" height="80"
src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Ccircle cx='40' cy='40' r='36' fill='%23e34f26'/%3E%3C/svg%3E">
<ul>
<li>Flour</li>
<li>Eggs</li>
<li>Milk</li>
</ul>
<h3>Preparation</h3>
<ol>
<li>Mix everything</li>
<li>Bake</li>
</ol>WarningNever forget the end tag and nest correctly:
<p><strong>Text</strong></p> is right, <p><strong>Text</p></strong> is not. The browser silently repairs mistakes – but the result is then often different from what you intended. Empty elements such as <img>, <br>, <hr>, <input> have no end tag.TipBlock-level elements (
<p>, <h1>, <ul>, <div>) start on a new line; inline elements (<a>, <strong>, <span>, <img>) flow within the text. You write comments as <!-- comment -->.