How to save the code of a web page

Note that most web pages are copyrighted and therefore this procedure should only be used for copying code that you have the right to use.

For many HTML assignments I ask students to use this HTML file as the starting point for their assignment. It is a very basic HTML file containing only page structure elements and standard required code for HTML5 files. And a little text. Click on the link to open that file.

To get the code from that page to use as the starting point for you assignment:

  1. Click on the link.
  2. A new browser page will open that displays the words "Basic HTML5 file."
  3. Right click on the page and the contextual menu will appear.
  4. Then, from the contextual menu that appears, select "View Page Source" or "Page Source" or something similar (the terms vary depending on the browser being used.
    1. You may also use these shortcut keys for viewing source code.
  5. A new page will open that contains the html code used for that page.
  6. Press Ctrl-A (Mac: ⌘-A) to select all the code.
  7. Then press Ctrl-C (Mac: ⌘-C) to copy all the code.
  8. Open a plain text editor:
    1. On Windows you can use Notepad (it is installed automatically with Windows):
      1. Start button > All Programs > Accessories > Notepad
    2. On Macs you can use TextEdit (it is installed automatically with the Mac O/S):
      1. Finder > Applications (in left sidebar) > TextEdit
      2. But note!!! You must make these preference settings.
  9. Paste the copied code into your new file:
    1. Ctrl-V (⌘-V Mac)
  10. Save your file. BE certain to manually add the file extension .html at the end of the file name. Otherwise a different extension will be added and the file will not be recognized by browsers or web page editors such as Dreamweaver.