Here’s how to type out your HTML code in Notepad:
- Open Notepad: Open Notepad on your computer. You can typically find it by searching for “Notepad” in the Start menu or by locating it in the list of installed applications.
- Create a New Document: Once Notepad is open, create a new document by clicking on “File” in the menu bar and selecting “New” or by using the shortcut Ctrl + N.
- Start HTML Structure: Begin by typing the HTML doctype declaration at the top of your document. It’s written as
<!DOCTYPE html>
, which informs the browser that you are using HTML5. - HTML Tags: Below the doctype declaration, you can start adding HTML tags to structure your web page. For example, you might use the
<html>
,<head>
, and<body>
tags. Remember to close each tag by adding the corresponding closing tag, such as</html>
,</head>
, and</body>
. - Add Content: Within the
<body>
tags, you can add various HTML elements and content. For instance, you can use<h1>
for headings,<p>
for paragraphs,<img>
for images,<a>
for links, and so on. Simply type the desired HTML tags and their content within the document. - Save the File: After completing your HTML code, save the file with the
.html
extension. Click on “File” in the menu bar, select “Save As,” and choose a location to save your file. Give it a meaningful name and ensure that the file extension is set to.html
. - View in a Web Browser: To view your HTML file, open a web browser (e.g., Chrome, Firefox, or Edge) and navigate to the location where you saved the file. Double-click the HTML file, and the browser will render and display your web page.
And, that’s it. You’ve officially written HTML code in Notepad. That said, I would strongly recommend upgrading to a code editor like Notepad++ or Visual Studio Code. These applications are made specifically for writing code and offer a number of features to help make web development easier.
If you learned something from this post, be sure to check out my complete HTML tutorial for beginners.