Introduction to HTML
HTML (HyperText Markup Language) describes the structure of a web page: which parts are headings, which are paragraphs, where the images and links go. Every page on the web is built on it.
HTML is one of the three languages every browser understands:
| Language | Its job |
|---|---|
| structure and content: headings, paragraphs, images, links | |
| how it looks (the CSS course) | |
| how it behaves (the JavaScript course) |
Your first page
Press Run to see this HTML rendered as a page.
<!DOCTYPE html>
<html>
<head>
<title>My first page</title>
</head>
<body>
<h1>Hello, web!</h1>
<p>This is my first web page.</p>
</body>
</html>The browser reads the tags and draws the page: a big heading, then a paragraph. Press Edit, change the heading text, and run it again.
Tags and elements
HTML is written with tags in angle brackets. Most come in pairs:
<p>is the opening tag,</p>is the closing tag (note the slash),- everything together,
<p>Some text</p>, is an element.
<h1>A main heading</h1>
<h2>A smaller heading</h2>
<p>A paragraph of text.</p>
<p>Another paragraph, with <strong>bold</strong> and <em>italic</em> words.</p>HTML describes meaning, not looks
HTML says what something is: a heading, a list, a link. How it looks (colour, size, layout) is the job of CSS, which you will learn in the CSS course. Keeping the two apart makes pages easier to change and easier for search engines and screen readers to understand.