<html> has
to be the first line of every file you are coding. It tells the browser
what kind of language it should expect. Of course, the files need
to have an .html file extension.
<html>
</html>
Remember to name
the first file that your visitors will see on your website to index.html,
when a visitor type in your url the browser displays the index.html
file first.
<meta> tags
are a html component which provide information that describes the
content of the webpage. Search engines looks at this tag when indexing
webpages into their database. Meta tags can be very powerful, so make
sure you use them correctly.
Description:
Short statement about your site, what it is about and what people
should expect when they visit your site. Try to stay below 30 words.
<meta
name="Description" content="Your Description">
Keywords:
These are the words that people will search for in the Search Engines.
There are several rules when it comes to keywords:
1. Do not repeat words more than three times.
2. Put your most important keywords in the beginning.
3. Separate each keyword with a comma.
4. Stay below 650 characters.
5. Do not use keywords that do not reflect the content of your website.
<meta name="Keywords" content="Your
Keyword1, Your Keyword2, Etc.">
Author:
Is the person or company that has legal rights to the page. It is
good business practice to include the webmaster's email.
<meta name="Author" content="Your
name, Your Email">
Generator:
What tool where used to build the site, not necessary but professional.
<meta name="Generator" content="The
Tool You Used">
Language:
Language used on you website. Use 2 letter abbreviation.
e.g. English = en.
<meta http-equiv="Content-Language" content="En">
Robots:
This is important. Below are the explanations for the different content
options.
Note: You can use more then one content option.
<meta name="Robots"
content="INDEX,NOFOLLOW">
ALL = Will
index your site in the search engine, and follow links.
NONE = Will
not index your site at all.
INDEX = Means
that robots will include this page in search database.
FOLLOW = Means
that robots will follow links from your page to find other pages.
NOINDEX = Allows
the subsidiary links to be explored, even though your page is not
indexed.
NOFOLLOW =
Allows the your page to be indexed, but no links from your page
are explored.
<body>
this is the most important tag of your webpage. The browser starts at
the body to encode your page content. There are several attributes that
goes into body tag:
1. bgcolor="#000000" - The background color.
2. background="images.jpg" - Uses a picture as the background.
3. text="#000000" - The color of your text.
4. link="#000000" - The link color.
5. vlink="#000000" - The link color after it has been clicked.
6. alink="#000000" - The link color when it is active.
The six-digit number and letter combinations represent colors
by giving their RGB (red, green, blue) value. The six digits are actually
three two-digit numbers in sequence, representing the amount of red,
green, or blue as a hexadecimal value in the range 00-FF. For example,
000000 is black and FFFFFF is white.
You can find a complete index of all the colors here.
<h>
is a tag that controls the size of the text. There are six levels of
the <hx> tag, where x is a number between 1 - 6. <h1> will
display the largest size of the text, and <h6> will display the
smallest.
<h6> This is the size of 6 </h6>
<h5> This is the size of 5 </h5>
<h4> This is the size of 4 </h4>
<h3> This is the size of 3 </h3>
<h2> This is the size of 2 </h2>
<h1> This is the size of 1 </h1>
Remember to close the <hx> tag with the forward
slash </hx>, otherwise your whole file will have the same heading.
<p> the
paragraph tag separate sections of your file into paragraphs. The
paragraph tag is used when you want to assign different properties
to different sections of your html file.
<li> there
are three types of lists you can use on your webpage. Unordered, ordered
and definition lists.
Unordered List: The unordered list starts with <ul> and continues with a
<li> for every list item.
<UL>
<li>First Bullet
<li>Second Bullet
<li>Third Bullet
</UL>
Result:
First Bullet
Second Bullet
Third Bullet
Ordered List:
The ordered list starts with <ol> and continues with a <li>
for every list item.
<ol>
<li>Number 1
<li>Number 2
<li>Number 3
</ol>
Result:
1. Number 1
2. Number 2
3. Number 3
Definition
List:
The definition list starts with <dl> and continues with a <dt>
for every term and <dd> for every definition.
<dl>
<DT>WWW</DT>
<DD>World Wide Web</DD>
<DT>FTP</DT>
<DD>File Transfer Protocol</DD>
</dl>
Result:
WWW
World Wide
Web
FTP
File Transfer
Photocell
Note that you
only need a the closing forward slash for <UL>, <ol>,
<dl>, <DT>, and <DT>, but not for the list items
<li>.
<pre> this
tag is used when you want to the text you type in your text editor
to stay exactly as you typed it. When the browser sees the pre tag
is will not try to interpret it, it will display it as is. The advantage
of the pre tag is when you want to use a lot of spaces and tabs. Without
the pre tag white spaces are ignored.
<pre>
Five Tabs
Four Tabs
Three Tabs
Twenty Spaces
</pre>
Note, make sure that you close the pre tag with the forward slash, otherwise
the browser will not read the rest of your html code </pre>.
<br>
the break tag forces a line break with between lines. So if you want
to create a break where a natural break is not warranted, that is when
your use the Br tag.
<hr> is
a horizontal ruler. Which creates a line across your page. The ruler
is very helpful when you want to separate two parts of text.
There are several properties to the <hr> tag:
1. width - The width of the ruler.
2. height - The height of the ruler.
3. noshade - If you want a shade of the ruler or not. Default is shaded.
4. color - The color of the ruler.
Anchors can
also be used to move a reader to a particular section in a file. This
is done by creating an anchor and a named anchor. The hash (#) mark
must be included.
<a href="#TopOfPage">Top Of Page</a>
Then you put the named anchor at the top of your page.
<a name="TopOfPage"></a>
You can also link to a specific section in a different file, then you
have to include the filename before the hash (#) mark.
<a href="index.html#TopOfPage">Top
Of Page</a>
When linking to a section in a different file you need to include the
<mailto>
is used to allow your visitors to send you an email with whatever
email program they might be using, Outlook, Eudora, etc. The mailto
anchor tag looks as follows:
<img
src> to display images on your website you need to call the images
from its location. <img src> stands for image source e.g. where
it is located. Remember that filenames are case sensitive.
<img src="filename.jpg">
The image size can be manipulated by using the width and height control.
<img src="filename.jpg" width="100"
height="50">
Width and height are in pixels.
You can also align images by using the align and valign properties.
The align tag has three properties: left, center, right, where
left is default.
The valign tag has also three properties: top, middle, bottom, where
middle is default.
You might have noticed that when you put the mouse over an image a small
text caption pops up, this is done with the alt property within the
image tag
<table>
are extremely helpful when creating the layout of your webpage. It
gives you control where text and images are placed on the page. The
table tags are:
<table> - Starts the table.
<tr> - Starts the table row.
<td> - Starts the table data.
</Td> - Ends the table data.
</tr> - Ends the table row.
</table> - Ends the table.
Example:
<table>
<tr>
<td>First Cell First Row</td>
<td>Second Cell First Row</td>
</tr>
<tr>
<td>First Cell Second Row</td>
<td>Second Cell Second Row</td>
</tr>
</table>
Result:
First Cell
First Row
Second Cell
First Row
First Cell
Second Row
Second Cell
Second Row
There are several
property tags with the table tags:
1. <table border="1">creates a border around
each cell.
2. <table align="left, center, right"> aligns the
content within the cells.
3. <table cellpadding="5"> creates a 5 pixel space
around the inside of the cell.
4. <table cellspacing="5"> creates a 5 pixel space
between the cells within the table.
5. <table bgcolor="#000000"> creates a background
color for the table. Note, bgcolor can be set for all the table tags:
<td bgcolor>, <tr bgcolor>, just remember that <td>
overrides the <tr>, <tr> overrides the <table>.
6. <table bordercolor> creates the color for the border.
7. <table width="100%" height="50%"> Width
and height of the table.
Example with all the attributes: <table width="70%" border="1"
cellspacing="5" cellpadding="5" bgcolor="#6699CC"
align="center"> <tr bgcolor="#66CCCC">
<td>First Cell First Row</td>
<td>Second Cell First Row</td>
</tr>
<tr>
<td bgcolor="#FF9999">First Cell Second Row</td>
<td bgcolor="#CCCCFF">Second Cell Second Row</td>
</tr>
</table>
<frame>
are a way to display several html files inside one window. The frame
page itself will not have any content on it, its function is only
to call the other html files. So, to create a frame page you need
one html file for every frame you have. The frame object are as follows:
<frameset> - Starts the frameset.
<frame> - Starts the frame.
</frameset> - Ends the frameset.
The <frameset> tag has several properties:
1. cols - Frame Columns.
2. rows - Frame Rows.
3. frameborder - Frame Border.
4. bordercolor
- Color of the Frameborder.
Note, the cols only only has to define the with of the first one,
15%, the other column is represented by the asterisk, *, which means
that it will take whatever space is available. In this case 75%,
Result:
left.html
right.html
The frame name
is used so that if you put a link in the left frame and want it to
open in the right frame, the link knows where to open.
<a href="file.html" target="right">File</a>
When using a frame page it is always good business practice
to put in an option for visitors who have a browser that are old and
do not have the capacity to display frame pages. What you do is put
a <noframe> tag after the <frameset>, so instead of displaying
the frame is shows what is between the <noframe> tag.
<frameset cols="15%,*">
<frame src="left.html" name="left">
<frame src="right.html" name="right">
</frameset>
<noframe>
You need
a newer browser to view this page.
</noframe>
Another
Frame Example:
<frameset
rows="10%,*">
<frame src="top.html" name="top">
<frameset cols="15%, *">
<frame src="left.html" name="left">
<frame src="right.html" name="right">
</frameset>
</frameset>
<noframe>
You need
a newer browser to view this page.
</noframe>
<form> are
used to send information through your webpage. There are several components
to the form tag.
First you need to open the form with the <form> tag. Inside
the form tag goes two pieces of information: action and method.
The action component tells the browser where to send the form. If
the form is being send through a cgi script, then the action will
point to the location of that script.
<form action="cgi-bin/formscript.cgi">
If the form is being send through email, then the action will
contain the standard mailto tag.
<form action="mailto:webmaster@codespy.com">
The second component is the method tag. Which instructs the browser
how to send the form information from the form. The options are GET
or POST. When using a mail form, then use POST.
<form method=POST>
So, the complete first form tag looks as follows if you use the mailto.
<input type="hidden"> are used when you want to send
information, but not display it to the user. When using hidden, you
need to set the value of that variable. This input type does not display
on the webpage.
<select> is a dropdown menu, which is a great idea if you have
a lot of choices, like country or state.
<select>
<option
value="">Select a country
<option value="US">United States
<option value="EN">England
<option value="MX">Mexico
<option value="CA">Canada
</select>
Now to the final part of the form tag, the submit and reset button.
<Input type="submit"> sends the form to the destination
that your declared in the action component.
<Input type="submit" value="Send
Form">
<input type="reset"> clears the form in case the user
wants to change the information.