Basic HTML


HEAD | BODY | IMG | FONT | A


To start out with your basic HTML page, you need this standard structure. You should use this for every HTML page you create.

<HTML>
<HEAD>
<TITLE> </TITLE>
Any HEAD Content Here
</HEAD>
<BODY>
Any BODY Content Here
</BODY>
</HTML>


Now, lets examine each part of the HTML page.

 

HEAD

No element in the HEAD tag can be directly seen on the browser screen. Here’s where you put the <SCRIPT> tags, when working with JavaScript,<STYLE> tags when working with Style Sheets, and any <META> info. However, most basic pages won’t use these elements, so lets just skip to the <TITLE> tag. Enter your title within the title tags. So if you type “John Doe’s Page” in between the <TITLE> tags, then you’ll see John Doe’s Page in the bar at the top of browsers.




 

BODY

This is the main content area of any HTML page. What you’re reading right now is the content we created between the BODY tags. Here’s the breakdown of all the major tags you’d need to make a simple, good looking page.














Tag Attributes Definition
CENTER None Centers text
P align=”right,center,left” Skips a line between paragraphs. Also justifies paragraphs.
BR None Carriage Return
HR size=”Pixel or Percent”
width=”Pixel or Percent”
noshade
Physical line dividing text.





 

Image Tag

<IMG src=”image.gif” width=”5″ height=”5″ alt=”Image!” border=”0″ align=”center”>
Explanation:
src: Path to image
width and height: Dimensions of image
alt: Alternative Text that loads up before image is loaded. Also text browsers use it for the image description.
border: Border around the image, in the color of the FONT color at the time.
align: where text aligns in comparision to the image.




 

Font Tag

Example: <FONT face=”Verdana” color=”#ff0000″ size=”2″></FONT>
Explanation:
face: Specify which font for the browser to use for display. Popular choices are Arial and Verdana. The user must have the font on their machine so make sure you select a commonly used font.
color: hex color that the text should be.
size: Size of the font. Range is from 1 (smallest) through 7 (largest).

Also:


<B> Bold </B>
<I> Italic </I>
<U> Underline </U>




 

Anchor Tag

Example: <A href=”somewhere.html” target=”_top”>Click</A>, or<A name=”here”>
Explanation:
href: Where the link is pointed to.
target: Used for frames mostly.
name: A place in the same page to go to. Add this tag for where you want the link to go, and <A href=”#nameofanchor”> for the actual link.