Introduction
What Is HTML?
Where Does HTML Come From?
Where Can I View HTML?
Where Can I Write HTML?
Basic Syntax
Basic Rules
Basic Elements
Example
Text
Formatting
Links
Lists
Images
Tables
Frames
Forms
Conclusion


Basic Elements
The basic structure to any HTML document should have these tags in common.

Doctype
Your HTML document should begin with the <!DOCTYPE> element. The <!DOCTYPE> tag will include the HTML version and refers to a document type definition. The DTD does just what it's name implies it defines the documents types such as elements and attributes, it also describes which relationships are applicable. You cannot assume that just because a document renders in a browser that the code is syntactically correct, some browsers will interpret your code even if it is not correct while others display the incorrect code in an unattractive manner. This is where validation software comes into play, they will read the DTD and check your code against it.

Here are three DTD's from www.w3c.org:

Strict
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
Transitional
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
Frameset
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN">

You may not wish to use the strict if you will use tags such as the <FONT> tag, which are being depreciated in favor of CSS (Cascading Style Sheets).

HTML
This is a simple element. The opening tag tells the browser that this is the beginning of an HTML document. With the exception of the <!DOCTYPE>, this tag should be the first to appear within your document. The closing HTML tag tells the browser that this is the end of and HTML document. This should be the last tag to appear in your document. The content model for the HTML tag only allows the <HEAD> and <BODY> tags.

Head
The Header tag is used to set apart supplementary information for the document from its content. Information that can be placed inside this tag is the title of your page, Meta information, JavaScript, Cascading style sheets, and other items. Both the header's opening and closing tags must come before the Body tag.

Title
The title tag is required to be on all your web pages. The title tags should be placed in between the opening and closing <head> tags. HTML tags should not be placed inside the title tag, for example you may not bold you name in your title, however you may use character entities such as the ampersand character. Some browsers use the title in its bookmark list. They can also display the title at the top of its window, and also on the taskbar. In addition, many search engines use the title tag in its search results. Therefore you may want to make your title descriptive and as a good representation of your document.

Meta Tags
In order to attract traffic to your site you must apply to search engines. Some of the most popular search engines are:

Yahoo :: Google :: AOL :: Ask Jeeves

Each search engine ranks and rates each site differently. The tag that you will use to affect your rank on a search engine is the Meta tag. Meta tags are used to store information. The Meta tag is an empty tag, and it is not required.

Use Meta tags with care, since they have been misused some search engines skip them or punish you when you misuse them. Do not include words that do not relate to any of your content for your website, and do not repeat words, search engines are not case sensitive.

Description
On some search engines a short description about your site is given, so that users can know a little bit about your site before entering. If you have this Meta tag in your code then the description that is displayed will be the description that you entered into the content attribute, but if this Meta tag is not found then the search engine will list the first words from your homepage, which may not effectively describe what your site is about. Use the name attribute to specifiy what kind of meta tag you are using and the content attribute for the actual description.

<META name="DESCRIPTION" content="This web site will introduce you to the basics of HTML">

Keywords
The purpose of this tag is to be used as a list of keywords that have relevance to your site. Some search engines will index your site, by looking for these keywords in your Meta tag. When someone types in a word in a search engine, the search engine goes through this tag to check to see if any of your words match those of the users, and if so your site will be included in the output search results. Each keyword must be separated a comma.

<META name="KEYWORDS" content="html, tutorial, web">

Body
The body tags should be placed inside of the html tags, right after the closing head tag. The body tag is where all your content will be placed, such as text, images, links and other media. The body tag will also include all of the HTML elements that will layout and format your content. There are many attributes for the body tag that control the appearance of your page and they will be discussed in the following section.

back  next

© Copyright 2000-2002 by Pepmint.com. All Rights Reserved

Search Pepmint.com

home :: tutorial :: portfolio :: links :: hammies :: guestbook :: contact