Getting Started
In this course you will build a small personal web page, and this chapter gets you ready.
HTML and CSS in One Minute
Think of a web page like a house:
| Part | Language | In a house |
|---|---|---|
| Structure and content | HTML | The walls, rooms and furniture |
| Look and feel | CSS | The paint, curtains and lights |
| Behaviour | JavaScript | The fan switch and the doorbell |
In this course we focus on the first two. You will write HTML to put content on the page, and CSS to make it look nice.
What You Need
- A web browser, such as Chrome, Edge or Firefox. You already have one.
- A text editor to write code. Notepad works. Visual Studio Code (free) is better.
- A folder for your project. Make a new folder on your Desktop called
my-page.
You can also do the whole course in your browser: every example has a Try it Yourself button that opens our online editor.
Your Very First File
Open your editor, create a new file and type this:
Example
<!DOCTYPE html>
<html>
<body>
<h1>Hello, world!</h1>
<p>This is my first web page.</p>
</body>
</html>Try it Yourself »Save it in your my-page folder with the name index.html. In Notepad, choose All Files as the type so it is not saved as a .txt file.
Open It in the Browser
Double-click index.html. Your browser opens and shows:
Hello, world! This is my first web page.
The words between the tags appear, but the tags themselves are hidden. The browser uses tags as instructions.
Tags in a Nutshell
Most HTML is written with a start tag and an end tag around some content:
Example
<h1>Hello, world!</h1><h1>is the start tag. It means "a main heading starts here".</h1>is the end tag. Notice the slash/.Hello, world!is the content.
The Work Loop
Every web developer works like this:
- Change the code in the editor.
- Save the file (Ctrl + S).
- Refresh the browser (F5).
Try it now: change "Hello, world!" to "Hello, I am Ayesha!" (or your own name), save, and refresh.
Example
<h1>Hello, I am Ayesha!</h1>
<p>This is my first web page.</p>Exercise
Exercise
After changing your HTML file, what must you do before refreshing the browser?
