[Home]  [Edit this page]  [Recent Changes]  [Special Pages]  [Help
HTMLBasicTags

An Introduction To Webprogramming

PART I: HTML

-----------------------------------------------------------

HTML Background Information

HTML, and the World Wide Web, have been founded in 1991 by Tim Berners-Lee at the CERN institute. After introducing the World Wide Web technology to transport data over the network, the people at CERN started working on HTML in order to have an easy formatting language that would be platform independent. Hence, HTML was born.

Today, HTML is the most popular programming language among webprogrammers, and it is the basis of other scripting languages like Perl or PHP.

HTML Basic Tags

This tutorial covers basic HTML Tags only. Basic HTML Tas are those, that appear in almost any website. Look at the list below to see them:

<a> //the anchor Tag
<body> //the body Tag
<br /> //the br Tag
<center> //the center Tag
<head>  //the head Tag 
<hr>    //the horizontal ruler Tag
<img>   //the image Tag
<meta>  //the meta Tag
<p>     //the paragraph Tag
<table>  //the table Tag
<title>  //the title Tag


the a Tag :

The a Tag is used as follows:
<a href="mypage.html">MyPage</a>


where href refers to the website you want to link to. The text between the opening and closing Tag is a replace string that appears instead of the websites name. If the website has the name hobbies.html the Tag looks like:

<a href="hobbies.html">Hobbies</a>


the body Tag :

The body Tag marks the beginning and the end of the area where you put your Tags of your document. The other sections of the document, like the head or title section are reserved for scripts only.

Yet, this is not the only use of the body Tag. The body Tag also has some attributes, that you can use to format your document.

//a document with blue background color and gold text
<body bgcolor="blue" text="gold"> 
</body>


You can also put JavaScripts in the body Tag or upload wave files, images etc.

the br Tag

The br Tag is used to create a single line break in the document. The br Tag does not have a closing Tag.

This text will broken here<br />
and continues here.


I am using the XHTML version of the br Tag here, because it helps getting a more coherent code in the document. The difference between XHTML and HTML version is the backslash at the end of the Tag. Without slash is the HTML version.

<br>   // HTML
<br /> // XHTML


the center Tag

The center Tag is used to center a text.

<p><center>This text appears centered in the document.</center></p>


the head Tag

The head Tag is seldom used in pure HTML. Only Cascading StyleSheet formattins or JavaScripts go there.

<head>
<style type="text/css">
</style>
<script language="javascript">
</script>
</head>


the horizontal ruler Tag

This Tag speaks for itself. It draws a horizontal ruler on the document. The <hr> Tag is one of the Tags that do not have a closing Tag.

<hr>


the image Tag

The image Tag is used to upload images to your document.

//an image of type JPG, with a width and height of 100 and left alignment
<img src="alexphoto.jpg" width="100" height="100" align="left" />
//an image of type GIF with a width and height of 100 and a border of 1 pt
<img src="alexphoto.gif" width="100" height="100" border="1" />


The image Tag supports the following file formats: JPEG, GIF, PNG, BMP and some other more exotic formats. The image Tag has several attributes and has no closing Tag. Some of the attributes are introduced in the examples above. The following list gives a short description of them:

src=""  //the image to be upload. 
width="" //the width of the image in pt
height="" //the height of the image in pt
border="" //the optional border of the image in pt
align=""  //the alignment of the image in the document


the paragraph Tag

The paragraph Tag is used to create a single paragraph in your document.

<p>This text is one paragraph.</p>


the title Tag

The title Tag speaks for itself. You will put your documents title here.

<title>My Homepage</title>


The paragraph Tag is most commonly used with StyleSheets.



Writing your first Website

After this short introduction into HTML basic Tags I will show you how to use them to write your first website in HTML.

<html>
<title>Our first Website</title>
<head>
</head>
<body bgcolor="beige" text="maroon">
<table border="0">
<tr>
<td>
<img src="alexphoto.jpg" width="100" height="100" border="1" align="left" />
<img src="alexphoto.jpg" width="100" height="100" border="1" align="right" />
</td>
</tr>
</table>
<h1><center>Welcome To My Homepage</center></h1>
<hr>
<p>Hello. Nice to see you at my Homepage. You will find all interesting and relevant information about me here. Just follow the links below to explore it. Have a lot of fun. If you like this page, feel free to come back.</p>
<center>
<a href="hobbies.html">Hobbies</a><a href="curriculum.html">C.V.</a>
<br />
<a href="career.html">Career</a><a href="photos.html">Photos</a>
</center>
</body>
</html>


last edited (June 1, 2004) by athomas, Number of views: 4166, Current Rev: 13 (Diff)

[Edit this page]  [Page history]  [What links here]  [Discuss this topic]  [Printer Friendly]  

Members

Username:

Password:


Register
Forgot Password?




Programmers Heaven - for .NET, Java, C/C++ and WEB Developers!
© 1996-2008 Community Networks Ltd. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Development by Tore Nestenius at .NET Consultant - Synchron Data.