Free tutorials for Java, Eclipse and Web programming



Follow me on twitter

Introduction to HTML

Lars Vogel

Version 1.3

26.06.2010 - 26.06.2010

Revision History
Revision 0.112.04.2008Lars Vogel
Created
Revision 0.2 - 1.212.06.2008 - 26.06.2010Lars Vogel
bug fixed and enhancements

HTML5

This article is a overview of HTML5.


Table of Contents

1. HTML5
1.1. What is HTML?
1.2. Your first HTML page
2. HTML Standard Elements
2.1. HTML Links
2.2. Lists
2.3. Tables
2.4. Links / Anchor
2.5. Image
2.6. Special signs
3. Semantic elements
4. Canvas
5. Drag and Drop
6. Geolocation
7. XHTML
8. Thank you
9. Questions and Discussion
10. Links and Literature

1. HTML5

1.1. What is HTML?

HTML (Hypertext Markup Language) is a standard to describe the content of webpages. HTML pages are text files which typically end with the ".html" extension. HTML is a so called "markup language".

The current version of HTML is HTML5. This version is still work in process but is already widely adapted by the browser vendors. I will therefore describe HTML5 syntax in this article.

1.2. Your first HTML page

Use a simple text editor, e.g. Notepad under Windows and save the following text as "page1.html". Do not use a editor as Winword as this editor saves additional information in the file it saves. Create the following text.

				
<!DOCTYPE html>
<html>
 <head>
  <title>An HTML5 Document</title>
 </head>
 <body>
  <h1>Your first HTML5 page</h1>
  <p>This is a <a href="http://www.vogella.de">link</a> to another webpage</p>
  <!-- this is a comment -->
 </body>
</html>

			

Open this page in a browser, e.g. by double-clicking on your page. The result should look like the following.

As you see in HTML you describe the structure of webpages in pure text — by defining text as headings, paragraphs, lists, etc. A tag is a text surrounded by angle brackets. Tags usually have a beginning and and end and contain other text between the start and end tag. The normal content of the webpage is placed between the <body> </body> tags, the <head> </head> tag contains general information about the webpage.

HTML5 introduced several new ways of classifying content of the webpage, e.g. <nav> </nav> for the navigation part of the page, <article> </article> to represent an independent article, <aside> </aside> to represent a sidebar with related information. <footer> </footer> for a footer in the HTML page and <address> </address> for the contact information of the author.