This powerful language is very easy to learn. You need not be a good programmer to learn HTML. If learnt with interest anyone can learn the basic features within a week.
Since HTML files are only text files it can be written using even the simplest editor like our Notepad. The other popular editors are WYSIWYG (What you see is what you get)
Editor, FrontPage and dreamweaver.
HyperText is a piece of text that acts as a link to another text. The term was coined by engineer Ted Nelson.
Markup is anything added to the content of the document that describes the text.
What does HTML file contain?
A document with HTML codes written in it should be always saved with .html or .htm extension. A HTML file contains small markup tags. Whenever a browser opens a .html file it searches for these tags as these tags tell the browser what to display or how to display the content on the web page.
Let us write a simple HTML document now. Keep in mind that the following is the basic structure of any HTML document. The tags in the below example should always be present in any HTML document.
If you are using windows open Notepad. Now type the code in the image as it is in your notepad.

After typing the content on the left in a Notepad, save it as firstpage.html or firstpage.htm in any of your local folder. It is better to use .html instead .htm as .htm is an old way of naming the HTML documents. Please Note that whatever is mentioned in the program is the minimum requirement for creating any web page or HTML document.
Running HTML document
Open Internet explorer. Click on File menu in the top of IE and click “Open” option.
Now browse for your firstpage.html and select it. Click on Ok You can see your first HTML page being displayed there. You will get an output similiar to the below picture.
NOTE: Please click on the below picture to get a bigger image.

CONGRATULATIONS!! YOU HAD CREATED YOUR FIRST WEB PAGE SUCCESSFULLY. SO creating web pages is not a big deal for you now.
Explanation of the above program
<html> -- This is the first tag of any HTML document. This is the tag which tells the browser that it is the beginning of a HTML document. This opening <html> tag will be always paired with the closing </html> tag.
</html> -- This is the last tag of any HTML document. This tags informs the browser that this is the end of the HTML document.
<head> -- This tag contains the header information. This will not be displayed on the browser.
</head> -- This tag is the closing tag of <head> tag.
<title> -- This tag comes inside the head tag. The information written between the title tag will appear on the top of the browser as the title of your HTML document. So here in our example “My first HTML page” will appear on the top of the page.
</title> -- This is the closing tag of your title tag.
<body> -- This tag contains the information that will be displayed on the page.
</body> -- This tag is the closing tag of the body tag.
Most of the tags in HTML will have a closing tag except for some tags like <br>.
It is always a good practice to close the tags.
Please let me know if you have any doubts.
No comments:
Post a Comment