Creating A Basic HTML Document


Lets Get Started!!!


Most of the matter on the web is no different than the stuff on your computer -it's just the complete bunch of files sorted into a set of directories.HTML files are nothing more than simple text files, so to start writing in HTML, you need nothing more than a simple text editor.


  • * Notepad is a common example (Right Click on Desktop --> New --> New Text Document ).



Type this in to your text editor:


Hello world

1. Now create a folder called my project and create a new file ,save it as mypage.html .


2. To preview the HTML files, they don't even need to be on the web and neither do you need to be connected to the internet. Just Open it with web browser.



Yeah !!! There it is. Your first web page. Very Well. And all it took was a few typed words.



1

Now lets work a more valid html page.


Tags

The basic structure of an HTML document includes tags, which surround content and apply meaning to it.

Change your document so that it looks like this:


<html>
<body>
Hello world
</body>
</html>

Now save the document again, go back to the web browser and refresh.


  • 1. The appearance of the page wont changed at all, but the purpose of HTML is to apply meaning, not presentation, and this example has now defined some fundamental elements of a web page.

  • 2. <html> is the opening tag that tells the browser that everything between that and the </html> closing tag is an HTML document.

  • 3. The stuff between <body> and </body> is the main content of the document that will appear in the browser window.


Closing tags


The </body> and </html> close their respective tags. ALL HTML tags should be closed.

NOTE: Not all tags have closing tags like this (<html></html>) some tags, which do not wrap around content will close themselves. The line-break tag for example, looks like this : <br />.



Attributes


Tags can also have attributes, which are extra bits of information. Attributes appear inside the opening tag and their value is always inside quotation marks. They look something like


<tag attribute="value">Margarine</tag>.

We will come across tags with attributes later.

Elements


Tags tend not to do much more than mark the beginning and end of an element.
As for example, the <title>and </title> are tags, <title>Online Portal</title> is a title element.



Page Titles


All HTML pages should have a page title. To add a title to your page edit your webpage as:

<html>
<head>
<title>
My web page</title>
</head>
<body>
This is my first web page </body>
</html>

The page now results as




Guys follow the various other tutorials to catch on further in html coding and designing !!!