Part One
What You Will Build
By the end of this chapter, you will have a complete HTML article page — the kind that any news publication could host. It will include every element a professional online article contains:
- A publication header with logo and section label
- A headline, deck (standfirst), and byline with date
- A hero image with caption and photo credit
- Structured body text with section headings
- A pull quote from a source
- An embedded map or video
- A key facts box (aside)
- Hyperlinks to sources throughout the text
- A footer with topic tags
The playground below contains a fully working article template. Your job is to replace every piece of placeholder content with your own real or imaginary story. Use any topic you like — local news, environment, politics, culture, technology.
Part Two
The Template — Edit Everything
HTML
CSS
Live Preview
Part Three
Final Checklist
Before you consider your article page complete, go through this list:
- Headline — is it specific, accurate, and does it answer "what happened"?
- Deck — does it add information the headline alone does not contain?
- Byline — does it include your name, a date, and a
<time datetime>attribute? - Hero image — does it have a descriptive
altattribute, a caption, and a photo credit? - Body text — is there at least one hyperlink to an external source? Are all quotes attributed?
- Pull quote — is it the most powerful line from a source, not a paraphrase?
- Fact box — does it contain specific, verifiable numbers?
- Embed — does the map or video have a
titleattribute and a<figcaption>with a source credit? - Tags — do the tags accurately reflect the content of the story?
- Semantics — have you used
<article>,<header>,<section>,<aside>, and<footer>appropriately?
.html file and open it in a browser, or publish it using a free service like GitHub Pages.
Part Four
Working Locally — VS Code & Live Server
The playground is great for learning, but your real workflow as a journalist-developer will be to write HTML in a proper code editor on your own computer. The industry standard, free editor is Visual Studio Code (VS Code). Pair it with the Live Server extension and your browser will refresh automatically every time you save a file — just like this playground, but for files you actually own.
Step 1 — Download and install VS Code
Go to code.visualstudio.com and click the download button for your operating system.
- Mac: Open the downloaded
.dmgfile, drag the VS Code icon into your Applications folder, then launch it from there. - Windows: Run the downloaded
.exeinstaller and keep all the default options. Make sure "Add to PATH" is checked — it will save you time later.
Step 2 — Install the Live Server extension
Extensions add features to VS Code. You need two minutes to install Live Server:
- Open VS Code.
- Press
Cmd + Shift + X(Mac) orCtrl + Shift + X(Windows) to open the Extensions panel. - Search for Live Server.
- Find the one by Ritwick Dey — it has several million installs — and click Install.
Step 3 — Open your article in VS Code
- Click Download in the playground above to get your
my-article.zip. - Unzip it — you will find
index.htmlandstyle.cssinside a folder. - In VS Code, go to File → Open Folder and open the unzipped folder. Always open the whole folder, not just a single file — this is important for Live Server to work correctly and for the CSS file to link properly.
Step 4 — Preview with Live Server
- In the VS Code file explorer (left panel), right-click
index.html. - Select "Open with Live Server".
- Your default browser opens the page at
http://127.0.0.1:5500. - Now edit and save the file — the browser refreshes automatically every time you press
Cmd + S(Mac) orCtrl + S(Windows).
- Prettier (by Prettier) — automatically formats and indents your HTML and CSS on save, so your code always looks clean.
- HTML CSS Support (by ecmel) — autocompletes class names as you type, which speeds up styling significantly.
Publishing online for free
Once your article is saved locally, you can share it with anyone. Two free options require no server knowledge:
- Netlify Drop — drag your project folder onto the page and get a public URL in seconds. No account required to try it.
- GitHub Pages — free hosting for any HTML files in a GitHub repository. Gives you a permanent, professional URL and a full history of every change you have ever made.
Setting up GitHub Pages — step by step
What is GitHub? GitHub is a platform where you can store files online — code, HTML, CSS, and anything else. Think of it as Google Drive, but designed specifically for web projects. Each project lives in a repository, which is just a folder on GitHub's servers.
What is GitHub Pages? It is a feature built into GitHub that takes the HTML files in a repository and turns them into a live website with a real public URL. You do not need to buy hosting or configure a server — GitHub handles all of that for free.
Why must the file be called index.html? When a browser visits a URL like https://yourusername.github.io/my-article, it does not know which file to show unless you tell it. Web servers are configured to look for a file called index.html by default and display it automatically. If your file is called article.html or anything else, the browser will show a blank error page instead. The Download button above already names the file index.html for you — do not rename it.
How does the repository name affect the URL? The name you give your repository becomes part of the web address. If your GitHub username is mariap and you create a repository named my-article, your page will be published at https://mariap.github.io/my-article. Choose the name carefully — it will be visible in the URL you share with editors and readers.
- Create a free account at github.com. Use a professional username — it will appear in the URL of everything you publish.
-
Create a new repository. Click the + icon in the top-right corner and choose "New repository". Give it a short, descriptive name — for example
housing-reportormy-articles. Set the visibility to Public (required for GitHub Pages on a free account), then click "Create repository". -
Upload your files. On the repository page, click "Add file" → "Upload files". Drag and drop
index.htmlandstyle.cssfrom your folder onto the upload area. Once they appear in the list, scroll down and click "Commit changes". Your files are now stored on GitHub. - Turn on GitHub Pages. Go to the Settings tab of your repository. In the left sidebar, click Pages. Under Source, select "Deploy from a branch". Set the branch to main and the folder to / (root). Click Save.
-
Wait one to two minutes, then refresh the Settings → Pages page. A banner will appear with your live URL — something like
https://yourusername.github.io/housing-report. Click it to see your published article in the browser, exactly as any reader would.
index.html, then click the pencil icon (Edit this file) to make changes directly in the browser. Click "Commit changes" when done. GitHub Pages will republish automatically within a minute or two. Alternatively, you can upload a new version of the file using "Add file → Upload files" and it will overwrite the old one.
Chapter Navigation
You have reached the end of Book 3.