At first we have to write HTML Using Notepad or Text Edit.
Web pages are created and modified by using the professional HTML editors.
That mostly HTML pages are recommend to create with simple text editor like Notepad (PC) or Text Edit (Mac).
Just follow the steps below to create our first web page with Notepad or Text Edit.
Step 1: Open Notepad (PC)
For the Windows 8 or later:
Just we have to open the Start Screen (the window symbol at the bottom left on your screen). Type Notepad.
With the Windows 7 or earlier:
First Open Start > Programs > Accessories > Notepad
Procedure 1: Open TextEdit (Mac)
Just Open Finder > Applications > TextEdit
We have to change some preferences to get the application to save files correctly. In Preferences > Format > choose “Plain Text”
Then we have to “Open and Save”, then check the box that says “Display HTML files as HTML code instead of formatted text”.
Then open a new document to place the code.
Procedure 2 : Write Some HTML
We can make write or copy some HTML into Notepad.
<!DOCTYPE html>
<html>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
Step 3: Save the HTML Page
To Save the file on the computer. We have to Select File > Save as in the Notepad menu.
Just name the file “index.html” or as you want and set the encoding to UTF-8 (which is the preferred encoding for HTML files).
You can make any of the either .htm or .html as file extension. There is no make difference
Step 4: View the HTML Page in Your Browser
We have to just do is just open the saved HTML file in our favorite browser (double click on the file, or right-click – and choose “Open with”).
You can run code to view the output
Example
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
