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:
- Click on the link.
- A new browser page will open that displays the words "Basic HTML5 file."
- Right click on the page and the contextual menu will appear.
- 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.
- You may also use these shortcut keys for viewing source code.
- A new page will open that contains the html code used for that page.
- Press Ctrl-A (Mac: ⌘-A) to select all the code.
- Then press Ctrl-C (Mac: ⌘-C) to copy all the code.
- Open a plain text editor:
- On Windows you can use Notepad (it is installed automatically with Windows):
- Start button > All Programs > Accessories > Notepad
- On Macs you can use TextEdit (it is installed automatically with the Mac O/S):
- Finder > Applications (in left sidebar) > TextEdit
- But note!!! You must make these preference settings.
- Paste the copied code into your new file:
- Ctrl-V (⌘-V Mac)
- 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.