In previous tutorial we have learned about Element, Tags and attributes. Now we learn how to create the first web page. HTML can be coded in any text editor like Notepad, Notepad++ or in Adobe Dreamweaver. Important: Always save the main file as “index.html” of your website. It will help you when you are uploading your website to server and server will recognize it as the home page of website.
How to Save HTML File
First of all you open any text editor or software for coding html. Here I will use Notepad++, now create a new file and save index.html. Remember every HTML document is saved with the extension of .html or .htm. Whenever you save a html document, remember to use .html or .htm at the end of file. It tells computer that it is web page.
Now come towards coding the page. First we have to tell the browser that it is a HTML document. So every HTML webpage starts with <html> and ends up at </html>. The whole page coded between <html> </html>. First one is opening tag and the second is closing tag. It tells browser that pages ends here.
Head and Body
There are two major sections of a web page. One is Head and the other is Body. In head we define the title, keywords and description of webpage. Head doesn’t appear on the webpage. The body is used for text and tags that are shown directly on the page. Everything that we want to show on the webpage should be in body.
Now we are going to set a title for our HTML document. For defining the title of the webpage, we use this code.
We have to use this tag in head. Here is an example how to use it.
How to add Content to Webpage?
<p> My first Website </p>
In body and save file.
Now open the folder where you saved your file and open it with any browser. You will see the first webpage you have created.