Every step tells you exactly what to type β and what to replace with your own info. Click a step to open it.
Create a new file called index.html and type the page skeleton.
Every HTML page must start with these exact lines. Open VS Code, create a new file, save it as index.html, then type this:
<!DOCTYPE html> β tells the browser this is HTML<html> β opens the whole page<head> β opens the invisible settings section<title>Your Name β Portfolio</title> β shown on the browser tab</head> β closes settings<body> β opens the visible page</body> β closes the visible section</html> β closes the whole pageYour Name with your actual name. For example if your name is Sarah, write: <title>Sarah β Portfolio</title><!DOCTYPE html>
<html>
<head>
<title>Sarah β Portfolio</title>
</head>
<body>
</body>
</html>
Add a heading 1 and write your own name as the text.
Inside <body>, on the blank line, add your h1. This is the biggest heading on the page β on a portfolio it is your name, big and bold at the very top.
<h1>Your Name</h1>Your Name with your actual full name. For example: <h1>Sarah Johnson</h1><body> <h1>Sarah Johnson</h1> </body>
After the h1, add 6 section headings using h2 β one for each section of your portfolio.
These are the main sections every portfolio needs. Type each one on its own line after your h1:
<h2>About me</h2><h2>My skills</h2><h2>My projects</h2><h2>Work experience</h2><h2>Education</h2><h2>Contact me</h2>Save and refresh Chrome. You should now see 6 headings appear below your name on the page.
<h1>Sarah Johnson</h1> <h2>About me</h2> <h2>My skills</h2> <h2>My projects</h2> <h2>Work experience</h2> <h2>Education</h2> <h2>Contact me</h2>
Wrap each h2 in a <section> tag. Then inside Work experience, add h3 sub-headings for each job.
A <section> wraps each group of related content together. Find your Work experience h2 and wrap it like this, then add h3 for each job role you have had:
<section><h2>Work experience</h2><h3>Job Title β Company Name (YearβYear)</h3><h3>Job Title β Company Name (YearβYear)</h3></section><h3>Frontend Developer β Acme Studio (2022β2024)</h3><h3>Freelance Projects (2023βpresent)</h3><section> <h2>Work experience</h2> <h3>Frontend Developer β Acme Studio (2022β2024)</h3> <h3>Web Design Intern β BlueCo (2021β2022)</h3> </section>
Go to the About me section and add two paragraphs using p tags β introduce yourself in your own words.
Body text always goes inside <p> tags. After your <h2>About me</h2>, type two paragraphs. You can copy the example below to get started, then edit it to be about you:
<p>Your first paragraph here.</p><p>Your second paragraph here.</p><p>Hi, I'm Sarah β a web developer based in London with a passion for building clean, fast, and accessible websites.</p><p>I love turning ideas into real products. When I'm not coding I enjoy photography and hiking.</p><section> <h2>About me</h2> <p>Hi, I'm Sarah β a web developer based in London with a passion for building clean, accessible websites.</p> <p>I love turning ideas into real products. When I'm not coding I enjoy photography and hiking.</p> </section>
Add your profile photo using an img tag inside the About me section.
The img tag is self-closing β no closing tag needed. It needs src (the file name) and alt (a text description of the image). Type this inside your About me section:
<img src="photo.jpg" alt="A photo of Sarah Johnson" width="200">photo.jpg.alt="A photo of me smiling in a park"width="300" for bigger.<section>
<h2>About me</h2>
<img src="photo.jpg"
alt="A photo of Sarah Johnson"
width="200">
<p>Hi, I'm Sarah...</p>
</section>
In the My skills section add a bullet list of your skills. In the My projects section add a numbered list of your top projects.
Use <ul> for bullets and <ol> for numbered. Each item goes in <li>. Type the skills list first:
<ul><li>HTML & CSS</li><li>JavaScript</li><li>React</li><li>Figma</li></ul>Now type the projects list:
<ol><li>Project name β one sentence about what it does</li><li>Project name β one sentence about what it does</li><li>Project name β one sentence about what it does</li></ol><li>Coming soon β currently learning HTML</li><section>
<h2>My skills</h2>
<ul>
<li>HTML & CSS</li>
<li>JavaScript</li>
<li>React</li>
<li>Figma</li>
</ul>
</section>
<section>
<h2>My projects</h2>
<ol>
<li>Portfolio website β my personal site built with HTML and CSS</li>
<li>Weather app β shows live weather using a public API</li>
<li>To-do list β a simple task manager built in JavaScript</li>
</ol>
</section>
In the Education section, create a table showing your school, degree, and years.
A table uses <table> to start, <tr> for each row, <th> for column headers, and <td> for data cells. Type this in your Education section:
<table><tr><th>School</th><th>Qualification</th><th>Years</th></tr><tr><td>University Name</td><td>BSc Computer Science</td><td>2019β2022</td></tr><tr><td>School Name</td><td>A-levels</td><td>2017β2019</td></tr></table><section>
<h2>Education</h2>
<table>
<tr>
<th>School</th>
<th>Qualification</th>
<th>Years</th>
</tr>
<tr>
<td>University of London</td>
<td>BSc Computer Science</td>
<td>2019β2022</td>
</tr>
<tr>
<td>City College</td>
<td>A-levels</td>
<td>2017β2019</td>
</tr>
</table>
</section>
In the My projects section, turn each project name into a clickable link to the live project or GitHub repo.
A link uses <a> with an href for the URL. Adding target="_blank" opens it in a new tab. Replace your plain <li> text with a link like this:
<li><a href="https://github.com/yourname/project" target="_blank">Weather App β shows live weather using a public API</a></li>href="#" as a placeholder.<section>
<h2>My projects</h2>
<ol>
<li>
<a href="https://github.com/sarah/weather-app" target="_blank">
Weather app β shows live weather using a public API
</a>
</li>
<li>
<a href="https://github.com/sarah/todo" target="_blank">
To-do list β a task manager built in JavaScript
</a>
</li>
</ol>
</section>
At the very top of <body>, before everything else, add a header with your name and a nav bar with links to each section.
The <header> goes first inside <body>. Inside it, put your name in a <strong> tag and a <nav> with links. Type this as the very first thing inside <body>:
<header><strong>Your Name</strong><nav><a href="#about">About</a><a href="#skills">Skills</a><a href="#projects">Projects</a><a href="#contact">Contact</a></nav></header>Your Name in the <strong> tag with your real name β for example: <strong>Sarah Johnson</strong>id="about" to your About me section: <section id="about"><header>
<strong>Sarah Johnson</strong>
<nav>
<a href="#about">About</a>
<a href="#skills">Skills</a>
<a href="#projects">Projects</a>
<a href="#contact">Contact</a>
</nav>
</header>
Add a fieldset with 3 radio buttons letting visitors pick a colour theme for your portfolio β Light, Dark, or Auto.
Radio buttons let users pick one option from a group. They all share the same name so only one can be selected at a time. Type this inside your header or just below it:
<fieldset><legend>Theme</legend><input type="radio" name="theme" id="light" checked><label for="light">Light</label><input type="radio" name="theme" id="dark"><label for="dark">Dark</label><input type="radio" name="theme" id="auto"><label for="auto">Auto</label></fieldset>Save and refresh. You should see a box with 3 radio buttons. Try clicking each one β only one can be selected at a time.
<fieldset> <legend>Theme</legend> <input type="radio" name="theme" id="light" checked> <label for="light">Light</label> <input type="radio" name="theme" id="dark"> <label for="dark">Dark</label> <input type="radio" name="theme" id="auto"> <label for="auto">Auto</label> </fieldset>
In the Contact me section, add a form with 4 fields and a submit button. Add validation so the browser checks the inputs β no JavaScript needed.
A <form> holds all the input fields. Each field needs a <label> above it. Adding required means the field cannot be empty. Adding type="email" makes the browser check for an @ symbol automatically. Type all of this in your Contact me section:
<form><label for="name">Your name</label><input type="text" id="name" name="name" required minlength="2" placeholder="Your full name"><label for="email">Your email</label><input type="email" id="email" name="email" required placeholder="you@example.com"><label for="reason">Reason for contact</label><select id="reason" name="reason"><option>Job opportunity</option><option>Freelance project</option><option>Just saying hi</option></select><label for="msg">Your message</label><textarea id="msg" name="message" required minlength="10" placeholder="Write your message here..."></textarea><button type="submit">Send message</button></form>Save and refresh. Try clicking Send message with empty fields β the browser shows an error automatically. Try a bad email like "hello" β it asks for an @ symbol.
placeholder="Tell me about your project..."<section id="contact">
<h2>Contact me</h2>
<form>
<label for="name">Your name</label>
<input type="text" id="name" name="name"
required minlength="2"
placeholder="Your full name">
<label for="email">Your email</label>
<input type="email" id="email" name="email"
required placeholder="you@example.com">
<label for="reason">Reason for contact</label>
<select id="reason" name="reason">
<option>Job opportunity</option>
<option>Freelance project</option>
<option>Just saying hi</option>
</select>
<label for="msg">Your message</label>
<textarea id="msg" name="message"
required minlength="10"
placeholder="Write your message here..."></textarea>
<button type="submit">Send message</button>
</form>
</section>