HTML & CSS · Beginner · 15 min
Your first HTML page
Use a heading and a paragraph to give a page a clear topic.
Give content meaning
HTML describes the meaning and structure of content. An opening tag, content, and a closing tag form an element. Use <h1> for the main heading and <p> for a paragraph. CSS changes their appearance later. You do not need any coding experience for this course.
<h1>My learning page</h1>
<p>I am learning to build websites.</p>Expected appearance
My learning page I am learning to build websites.
Build a document
A complete file starts with a doctype. The <html> element contains <head> for metadata and <body> for visible content. The lang attribute identifies the document language. The title appears in the browser tab. Our preview supplies this outer document, so enter the content inside <body> and any <style> element in the editor.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>My learning page</title>
</head>
<body>
<h1>My learning page</h1>
</body>
</html>Expected appearance
My learning page
Try it yourself
Code runs on this device. When you are signed in, drafts sync to your account.
Edit the page content and include CSS in a style element. The preview supports a limited set of HTML elements. Scripts, external resources, navigation to other sites, and form submission are disabled.
Build and check
Create one <h1> containing “My learning page” and one <p> containing “I am learning HTML.” Keep both texts exactly as written for this check.
Use <h1> for the heading and <p> for the sentence. Close both elements.
Show worked solution
<h1>My learning page</h1>
<p>I am learning HTML.</p>Use <h1> for the heading and <p> for the sentence. Close both elements.
Page preview
Run to preview your page. Check tests the task requirements, including the requested screen widths. Check results do not replace keyboard and visual review.
Try it yourself
- Complete the task and use Check to test it.
- Change the paragraph to introduce a hobby, then preview the result.