HTML and CSS

Lesson 1 of 10

Lesson ยท 6 min

Your first page

Pages are made of elements

A web page is a text file written in HTML. HTML describes the parts of a page, and each part is called an element.

Most elements have an opening tag, some content, and a closing tag:

<h1>A big heading</h1>
<p>A paragraph of text.</p>
  • h1 is the top-level heading. A page usually has one.
  • p is a paragraph.

The closing tag has a slash: </p>. The browser reads the tags and shows the content, not the tags.

Your turn

Type your HTML in the editor. The editor does not add closing tags. Type the opening tag and the closing tag yourself.

The preview on the right updates when you press Run.

Tasks

2 to do

  1. Task 1, not checked yet. Add a heading with the text My first page. Use an h1 element.

  2. Task 2, not checked yet. Below the heading, add a paragraph that says Hello, web! Use a p element.

Task 1 of 2

Add a heading with the text My first page. Use an h1 element.

All tasks

index.html

Ctrl+Enter runs your code. Ctrl+Shift+Enter checks it. Press Esc, then Tab, to leave the editor.

Preview

Your page shows here