HTML Editors and Your First Web Page
> Set up a coding environment, create an HTML document, preview it, and troubleshoot common editor issues.
**Cyber Code Academy · HTML Tutorial · Lesson 02 · Beginner**
## 1. What is an HTML editor?
An HTML editor is a tool used to create and edit text files containing HTML. HTML is plain text, so you do not need an expensive development tool to begin. A basic text editor is enough, although a code editor provides useful features.
Common options include:
– Visual Studio Code (VS Code).
– Notepad on Windows.
– TextEdit in plain-text mode on macOS.
– Other code editors of your choice.
For this course, we will use VS Code in the examples.
## 2. Install and open VS Code
1. Download VS Code from the official website: https://code.visualstudio.com/
2. Install and open the application.
3. Select **File → Open Folder**.
4. Create or select a folder named `html-practice`.
5. Create a new file named `index.html`.
Do not create a Word document and rename it to HTML. Use a plain-text code editor.
## 3. Understand the workspace
A code editor normally has:
– **Explorer:** displays project files and folders.
– **Editor:** where you write HTML.
– **Terminal:** where you can run development commands.
– **Status bar:** displays information such as file type and line/column.
– **Extensions:** add optional editor features.
You can learn HTML without installing any extension. VS Code already includes HTML syntax highlighting and basic suggestions.
## 4. Create your first page
Type this complete example into `index.html`:
“`html
Welcome to My Website
My name is Krishna.
I am learning HTML at Cyber Code Academy.
“`
Save the file using **File → Save** or the keyboard shortcut for your operating system.
## 5. Preview the HTML page
You can preview a basic HTML file without a web server:
1. Open the project folder in Finder or File Explorer.
2. Double-click `index.html`.
3. Your default browser opens the page.
4. Return to VS Code, change some text, and save.
5. Refresh the browser to see the updated result.
For larger projects, use a local development server. It provides a predictable local URL and can reload pages automatically when configured.
## 6. Understand file extensions
| Extension | Typical use |
|—|—|
| `.html` | HTML document |
| `.css` | Stylesheet |
| `.js` | JavaScript |
| `.png`, `.jpg`, `.svg` | Images |
| `.md` | Markdown documentation |
Make sure the file is truly saved with the `.html` extension. Some editors hide extensions, so check the full filename when troubleshooting.
## 7. VS Code HTML features
– **Syntax highlighting:** tags and attributes appear in different colours.
– **Auto closing tags:** the editor may add a closing tag when you create an opening tag.
– **Emmet abbreviation:** typing `!` in an empty HTML file and accepting the Emmet suggestion can generate a basic document skeleton.
– **Formatting:** a formatter can indent code consistently.
– **Search:** find a tag or word across the project.
These are editor conveniences; they do not replace learning HTML syntax.
## 8. Browser Developer Tools
Developer Tools help you examine a page:
– **Elements/Inspector:** inspect the DOM and edit markup temporarily.
– **Console:** view JavaScript errors and messages.
– **Network:** inspect requested files and identify missing resources.
– **Responsive mode:** preview the page at different viewport widths.
A change made directly in the Inspector is usually temporary. Make permanent changes in your source file.
## 9. Common errors and solutions
| Problem | Possible reason | Solution |
|—|—|—|
| Browser shows code as text | File saved with wrong extension | Check that it ends with `.html` |
| Changes do not appear | File not saved or browser not refreshed | Save and refresh |
| Image is missing | Incorrect image path | Check folder and filename |
| Special characters look wrong | Encoding issue | Save using UTF-8 |
| Indentation is inconsistent | Mixed spaces/tabs | Use editor formatting |
## 10. Practice project: About Me page
Create a page with:
– A descriptive browser-tab title.
– Your name as the main heading.
– A short introduction.
– A list of three learning goals.
– One link to an official learning resource.
Open the file in a browser. Change one sentence and confirm that your saved change appears.
## 11. Knowledge check
1. What is an HTML editor?
2. Why should you use a code editor rather than a word processor?
3. What is the purpose of the VS Code Explorer?
4. What does the browser Inspector show?
5. Why might an image fail to load?
**Next lesson:** HTML Document Structure — understand every part of a complete HTML page.
Want to learn this professionally?
Explore practical IT training at Cyber Code Academy.
View Academy Courses