Coding Lesson
First success
Save your work
Your goal: Keep a copy you can use again.
Learn
A preview is not a backup. In this lesson you will keep your edited hobby page, reopen it, and prove that the saved copy contains your changes. Run Code, Save draft on this device, and Download HTML do different jobs; learning the difference prevents lost work.
Walkthrough: why the code works
Make a change you can recognise
Open the starter in the Sandbox, or use Open HTML file to continue your downloaded hobby page. Change the h1 to a distinctive heading such as My balcony garden. Choose Run Code and check the preview. This shows the current editor contents; it does not create a file on your computer.
<h1>My balcony garden</h1>Keep a convenient browser draft
Choose Save draft on this device. This is useful when returning to this lesson in the same browser. Load saved draft restores that lesson’s saved code. It is not a copy on another device, and clearing browser storage can remove it. Download important work as well.
Download a portable copy
Choose Download HTML and find the file in your browser’s downloads or the folder you selected. Give it a recognisable name such as my-hobby.html. Keep the .html extension. The file contains your HTML and any CSS or JavaScript written inside it; pictures referenced by a URL or filename are not bundled into the download.
Prove that you can reopen it
Open the downloaded file in a browser and look for your distinctive heading. To edit it again in the Sandbox, choose Open HTML file and select that file. To edit locally, open it in a plain-text code editor. A browser displays the page; an editor lets you change its source.
Repeat the save-and-check routine
Change one sentence, run the preview, and download another copy. Check which copy you reopen: browsers may add a number to repeated downloads. Keep a dated backup before making a large change. A local file is not published online; that comes in lesson 18.
Expected results
The preview and downloaded page both display My balcony garden, or your own distinctive heading.
Reopening the HTML in the Sandbox restores the code you downloaded, even if you have navigated away from the lesson.
The downloaded file normally opens at a file: address. Other people cannot visit that address on your computer.
Common mistakes and how to fix them
The reopened page has old text: Check the filename and download time. Download again after editing, and open that new copy rather than an earlier tab.
The browser displays source code: Check that the actual filename ends in .html rather than .html.txt. Use a plain-text editor, not a word-processing document.
An image disappears after downloading: The HTML references the image; it does not contain a copy of that file. Preserve its working web address or keep a local image beside the HTML and update src.
View starter code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>My hobby page</title>
<style></style>
</head>
<body>
<h1>My hobby</h1>
<p>I enjoy learning something new.</p>
</body>
</html>Your challenge
Change the heading, save a draft, and download your HTML. Open the downloaded file.
Keep developing your hobby page: Download HTML before leaving the sandbox, then choose Open HTML file when returning to your project. Load saved draft restores only this lesson’s draft in this browser.
Practise in the sandboxShow a hint
Use Save draft on this device, then Download HTML. Your browser may ask where to save the file.
Show a sample answer
Try the challenge first. This is one possible answer or a snippet to adapt.
Save the file as my-hobby.html. Open it in a browser to view it or in a Code Editor to edit it.Check your work
The downloaded page opens and contains your changed heading.
Completion is your own check, not an automatic grade.
