The Head element <head> contains several items which are read by the Browser and also by Search engines, such as "Google", but they are hidden from the reader. Some of these items are called "Meta Tags" and are optional. They will be discussed later.
The title element <title>must be the first right after HEAD. It contains your document title which is typically displayed in the title bar at the top of the browser window. The title
identifies your page for search engines and for bookmark lists. It should uniquely describe the contents of your Web page and must be less than 64 characters.
You must close with the end tag </title>.
The HEAD section must be closed with the end tag </head>
Background and Text Colors.
Carriage returns in HTML files aren't significant. In fact, any amount of whitespace -- including spaces, linefeeds, and carriage returns -- are automatically compressed into a single space when your HTML document is displayed in a browser. Word wrapping can occur at any point in your source file without affecting how the page will be displayed.
You indicate the start of a paragraph with the tag <p>.
The end of a paragraph is shown with the closing tag </p>. Many tutorials tell you that a closing tag is not needed.
Popular attributes are <p align="left">
You provide a line break without white space between lines with the tag <br>. There is no closing tag, but the new rigorous standards require you to write this tag thus: <br />. For example:
My address is: <br />John Doe <br />123 Main Street <br />Newtown, NJ 08901
HTML has six levels of HEADINGS, numbered 1 through 6, with 1 being
the largest. Headings are typically displayed in larger and/or bolder
fonts than normal body text.
The syntax of the heading element is:
<hy>Text of heading </hy>
where y is a number between 1 and 6 specifying the level of the heading.
Heading tags may incorporate attributes:
< align="left">, this is the default if no alignment specified.
Note:Headings automatically include a line break and a line of space.
Example: <h3 align="center">
There are three tags that change the appearance of any text elements between them:
<b> bold face, up to the end tag </b>
<i> text in italics, up to the end tag </i>
<tt> mono-spaced typewriter text up to the end tag </tt>
You may nest tags to combine several elements, but the end tags must be placed in exactly the reverse sequence. For example: <b><i>bold italics </i></b>.
<b><i> aaa </b></i> is incorrect and will produce unexpected results.
You may use all the characters on the typewriter keyboard, including all letters, numerals and symbols (so called "ASCII characters"), except the less-than and greater-than symbols < and > and the ampersand &. These symbols have special meaning in HTML markup code. To represent them we use what are called escape sequences.
Whether to replace the quotation mark " with the equivalent escape sequence is optional. However, to designate additional white spaces it is essential to use the escape sequence . Certain other popular symbols, such as the British pound £ and the Euro € can only be represented in this manner. The table below lists these symbols.
There are many accented letters in languages such as French, German, Polish, Russian, etc, that cannot be typed on an English keyboard. See Special characters for a discussion of this complex subject.
This paragraph is aligned left, this is the default mode.
This paragraph is center aligned.
This paragraph is aligned right.
Example of address, with line breaks:
My address is:
123 Main Street
Newtown, NJ 08901
Examples of headings:
text in italics,
text in mono-spaced type,
The Web page designer may specify font face, color and size for the entire document in the <body> specification. You can also change them at any place in the text, for example in a specific paragraph:
<font size="+1" color="#ff0000">This is red text, one size larger than default size</font>. Don't forget to put end tag </font>!
Don't overuse this feature. It is better to use Style sheets for this purpose, but that's another subject. You can use sizes "+1" for one size larger, "-1" for one size smaller. Still larger and smaller sizes are possible but I recommend against them.
You can also change font face to a non-serif style (the most frequently used) as follows:
<font face="Arial, Helvetica, non-serif">This line is in a non-serif font face, the actual appearance depends upon your Browser.</font>.
Here is how these two font examples appear on your Browser (this is the default font for your Browser):
This is red text, one size larger than default size
This line is in a non-serif font face, the actual appearance depends upon your Browser..
Return to 1 ; Continue to Part 3 - Links ; 4 ; 5 ;
Last update November 2003