Web pages can be created and edited using professional HTML editors.
However, for learning HTML, we recommend using a simple text editor like Notepad (PC) or TextEdit (Mac).
We believe that using a basic text editor is an effective way to learn HTML.
Follow the steps below to create your first web page with Notepad or TextEdit.
For Windows 8 or newer versions:
Open the Start Screen (the window symbol at the bottom left on your screen). Type Notepad. |
For Windows 7 or older versions:
Open Start > Programs > Accessories > Notepad |
Open Finder > Applications > TextEdit
Also change some preferences to get the application to save files correctly. In Preferences > Format >choose “Plain Text”
Within the “Open and Save” section, enable the option “Display HTML files as HTML code instead of formatted text.”
Finally, initiate a new document to start coding.
Enter or copy the following HTML code into Notepad:
<!DOCTYPE html> <html> <body> <h1>My First Heading</h1> <p>My first paragraph.</p> </body> </html> |
Save the file on your computer. Select File > Save as in the Notepad menu.
Title the file as “index.htm” and choose UTF-8 for the encoding, as it’s the recommended format for HTML documents.
Tip: You can choose either .htm or .html as the file extension. There is no distinction; it’s your preference. |
Open the saved HTML file in your favorite browser (double click on the file, or right-click – and choose “Open with”).