Now lets see what exactly is HTML (Hyper Text Markup Language). It is a type of data file which is transferred to the client machine. The HTML file gets translated and displayed on the screen if the client is using a Web browser like Netscape Navigator, Microsoft Internet Explorer etc. Let me give you a brief description of HTML.
What is an HTML File?
Go ahead and try it!
If you are running Windows, start Notepad.
If you are using Mac, start SimpleText.
Start TextEdit in OSX and change the following preferences: Open the the "Format" menu and select "Plain text" instead of "Rich text". Then open the "Preferences" window under the "Text Edit" menu and select "Ignore rich text commands in HTML files". If you do not change the preferences above, your HTML code will probably not work.
Type in the following text:
<html> <head><title>Title of page</title></head>
<body> This is my first homepage. <b>This text is bold</b> </body> </html><html> <head><title>Title of page</title></head>
<body> This is my first homepage. <b>This text is bold</b> </body> </html>
Save the file as "firstpage.htm".
Start your Internet browser. Select "Open" (or "Open Page") in the File menu of your browser. A dialog box will appear. Select "Browse" (or "Choose File") and locate the HTML file you just created - "firstpage.htm" - select it and click "Open". Now you should see an address in the dialog box, for example "C:\MyDocuments\firstpage.htm". Click OK, and the browser will display the page.
Lets have a look at print preview of the above example.
Description of the above Example.
We have started the HTML document by using the <html> tag and ended the same by using </html> tag. These two tags tell the browser about the starting and the ending of the document. Points to note:
Remember, use either the .htm or the .html extension while saving an HTML file. Well, it is preferable to use .html extension.
Liked it! Share this Tutorial