Thursday, December 29, 2011

How to write your first HTML page?

As this is going to be my first post on this blog I would like to start with HTML syntax. A html page is composed of tags. Tags are: html, head, body, p, h1, h2, div, span and others. Each one has a beginning and must have its end. So if you have a '<body>' tag then must have a '</body>' tag.
Here is a short example of an almost empty page in html.


<html>
   <head>
       <!--   hear will be head content: like css, javascripts, page title -->
   </head>
   <body>
       <!--   as tag is called: here you will put main content -->
       <h1> Your first header!!! </h1>
   </body>
</html>


Copy this code in a new text document. You could use Notepad. Save document as firstPage.html and open it with a browser(Firefox, Chrome, Internet Explorer).


Congratulations!!! You have just wrote your first page in html.