Command Palette

Search for a command to run...

Hectal
Phase 1Beginner2 of 8 in HTML

HTML Basics: Elements and Text

Elements, tags and attributes, headings and paragraphs, text formatting, entities, lists, links, images and file paths: the everyday HTML of every page.

In Phase 0 you wrote your first page. Now you'll learn the pieces it is made of. Every web page is built from elements: a heading, a paragraph, a list, a link, an image. Each one is written with tags and fine-tuned with attributes. Once you can read and write those three things, you can read the HTML of any website.

You'll learn which element to use for which job and *why* the choice matters: screen readers, search engines and browsers all rely on it. You'll see how the browser treats spaces and line breaks, how to show characters like < and ©, how to make lists, links and images, and how to point from one file to another with paths, the skill that trips up more beginners than any other.

Every topic has live examples to edit, things to break on purpose, and interview-grade questions. The exercises at the end build up to a small profile card using everything in this phase.

0/8 · 0%
8 topics ~3 h 23 code blocks & diagrams
Start with the first topic
1
1.1

Elements, Tags and Attributes

An element is one piece of a page, written as an opening tag, some content and a closing tag; attributes inside the opening tag add extra settings like an id, a link address or an on/off switch.

24 min 3 code practice

2
1.2

Headings and Paragraphs

Headings <h1> to <h6> give a page its outline from most to least important, paragraphs <p> hold blocks of text, and the browser squeezes all spaces and line breaks in your code into single spaces.

19 min 3 code practice

3
1.3

Text Formatting and Meaning

Text-level elements mark what a word means: <strong> for importance, <em> for stress, <mark> for highlights, <del>/<ins> for edits, <sub>/<sup> for small raised or lowered text, and a few more; the look comes free, but the meaning is the point.

25 min 3 code practice

4
1.4

Comments, Whitespace and Character Entities

Comments are notes in your HTML that the page doesn't show; character entities like &lt; and &amp; let you show characters that HTML would otherwise treat as code, which is also the basis of safe escaping.

24 min 3 code practice

5
1.5

Lists

HTML has three lists: <ul> when order doesn't matter, <ol> when it does (with start, reversed and type to control the numbers), and <dl> for terms and their descriptions; lists can nest inside list items.

23 min 2 code practice

6
1.6

Links

The <a> element with an href makes a link: to another site (absolute URL), another file on your site (relative path), a spot on the same page (#id), an email or phone number, or a file to download.

24 min 3 code practice

7
1.7

Images

<img> shows a picture from the file in src, describes it in words with alt, and should state its width and height; picking the right file format and writing good alt text matter as much as the tag.

25 min 3 code practice

8
1.8

File Paths and Project Folders

A website is a folder of files, and every link, image and stylesheet finds its file through a path; relative paths start from the current page's folder, index.html is the default page of a folder, and on real servers letter case and spaces matter.

25 min 3 code practice

Practise this phase

Hands-on exercises: write the code, see your page live, and press Check to have it tested automatically.