Build a Web Page: HTML and CSS Basics
Every web page you visit is built with code that a browser turns into the page you see.
HTML
HTML stands for HyperText Markup Language. It describes the structure and content of a page using tags. Tags go inside angle brackets and usually come in pairs: an opening tag and a closing tag with a slash.
A Simple Page
<html>
<head>
<title>My Page</title>
</head>
<body>
<h1>All About Me</h1>
<p>My favourite animal is a hedgehog.</p>
</body>
</html>
- <title> is the name shown in the browser tab.
- <h1> is the biggest heading. Smaller headings are <h2> and <h3>.
- <p> is a paragraph.
More Tags
| Tag | What it does |
|---|---|
| <ul> and <li> | a bulleted list and its items |
| <a href="..."> | a link to another page |
| <img src="..." alt="..."> | shows a picture |
Alt text describes an image to people who cannot see it, such as someone using a screen reader. Good web designers always add it.
CSS
CSS (Cascading Style Sheets) controls how things look: colours, fonts, spacing and layout.
h1 {
color: purple;
font-family: Arial;
}
This makes every <h1> heading purple.
Staying Safe When You Publish
- Never put your full name, address, school or photos of yourself on a public page without an adult's permission.
- Ask a teacher or parent before publishing anything online.
Try It
Make a page about your favourite hobby with a heading, two paragraphs, a list and a picture.
Curriculum link: National Curriculum in England: Computing programmes of study (DfE) — Key Stage 2: select, use and combine a variety of software to design and create a range of programs, systems and content; understand computer networks including the World Wide Web