Using a basic text editor like Notepad (on Windows) or TextEdit (on macOS) to learn HTML is a great place to start. These tools are simple, but sufficient to allow you to write and view basic HTML code and help you understand the structure and syntax of HTML. Below I'll explain each step in detail to make sure you can successfully create and view your first HTML web page.
Step 1: Launch Notepad (or TextEdit)
For Windows users (Notepad).
- Click on the "Start" button.
- In the Start menu, select All Programs.
- In the "All Programs" list, find the "Accessories" folder and open it.
- In the "Accessories" folder, click on "Notepad" to launch it.
For Mac users (TextEdit).
- In the Finder, open the Applications folder.
- Find and double-click the "TextEdit" application to launch it.
Step 2: Edit the HTML with Notepad (or TextEdit)
In the open Notepad (or TextEdit) window, enter your HTML code. For example, a simple HTML page might look like this:
<!DOCTYPE html>
<html>
<head>
<title> My first web page </title>
</head>
<body>
<h1>Welcome to my web page</h1> <body>.
<p> This is a simple page written in HTML. </p>
</body>
</html>
Step 3: Save HTML
- In Notepad (or TextEdit), click on the File menu.
- Select "Save As..." .
- In the Save dialog box that pops up, choose a folder that is easy to remember (e.g. "w3school") and enter your file name in the File name box, e.g. "". Make sure the file extension is
.html
maybe.htm
。 - Click "Save".
Attention:
- For Mac users: If you're using TextEdit, make sure you save the file in "Plain Text" format, not "Rich Text" format. TextEdit may save files in Rich Text format by default, which can add extra formatting code to the file that breaks the HTML code. You can avoid this problem by choosing Plain Text in the Format drop-down menu of the Save dialog box.
Step 4: Run this HTML file in your browser
- Open your browser (e.g. Chrome, Firefox, Safari, etc.).
- Use the "Open File..." option in your browser's "File" menu, or just double-click on your HTML file in File Explorer (or Finder). option in your browser's "File" menu, or just double-click on your HTML file in File Explorer (or Finder).
- Your HTML page should open in a browser and display the content you have written.
Follow these steps and you're ready to use Notepad (or TextEdit) to create and view your first HTML page.
This article was written by Learning Together Posted!