HTML Cheatsheet
Comments
Paragraph
Blank Row
Horizontal Rule
Change the Font
Font Color
Background Color
Background Wallpaper
Font Sizes

Headings

Text Alignment
Margins
Physical Tags
Images
Spaces
Bullet Lists
Number Lists
Links
Link Colors
Email Link

   

Basic HTML format document. All HTML pages must include the following:

<HTML>

<HEAD>
< TITLE> </TITLE>
< /HEAD>

<BODY>

Displays in browser window
 

</BODY>
< /HTML>


Comments

< !-- and --> use these commands and your comments will not show up on the page.


Basic Tags

Paragraph (you don't need a closing tag)
<p>

Blank Row (you don't need a closing tag)
<br / >


Horizontal Rule (you don't need a closing tag)
<HR / >

To change the thickness and width of the <HR>
<HR SIZE="12" WIDTH="50%"
>

To change the color of the <HR>
<HR COLOR="#0000FF">

To add NO SHADE to your <HR>
<HR NOSHADE>


Change the Font

<FONT FACE="arial, times new roman">arial font</FONT>

<FONT FACE="algerian, arial">algerian font</FONT>

**Note - it is a good idea to list more than one font name in the FACE attribute, in case the first font is not available on the viewer's computer.


Font Color

<FONT COLOR="red">Your colored text</FONT>

or

You can use the hexadecimal code <FONT COLOR="#00cc66">Your colored text</FONT

To see more colors try Visibone.


Background Color - This color should always complement your text color.

<body bgcolor="green">

or

<body bgcolor="#0099ff">

Background Wallpaper
<BODY BACKGROUND="image.gif">


To see more colors try Visibone.


Font Sizes

Tthere are 12 font size commands available to use. +6 through +1 and -1 through -6. +6 is the largest.

<FONT SIZE="+6">This is +6</FONT>

<FONT SIZE="+1">This is +1</FONT>

<FONT SIZE="-1">This is -1</FONT>

<FONT SIZE="-6">This is -6</FONT>

Size Attribute
Font Size
Font Size 1 8 points
Font Size 2 10 points
Font Size 3 12 points
Font Size 4 14 points
Font Size 5 18 points
Font Size 6 24 points
Font Size 7 36 points

or you can use headings.

Headings

<H1>This is Heading 1</H1>
< H2>This is Heading 2</H2>
< H3>This is Heading 3</H3>
< H4>This is Heading 4</H4>
< H5>This is Heading 5</H5>
< H6>This is Heading 6</H6>

Also,

 


Text Alignment

Center
<center> use this if you want text centered on the page </center>

Rigt Aligned
< P ALIGN="right">Text in here is pushed to the right margin</P>


Margins

Within the <body> tag

<BODY LEFT MARGIN="80" RIGHT MARGIN="80">


Physical Tags

Bold
<B> </B>

Italics
<i> </i>

underline
<u> </u>


 

Images

Inserting an Image

<IMG SRC="image.gif">

IMG stands for "image." SRC stands for "source." Remember, you must have your images and your pages all in one folder.

Aligning your images
<IMG ALIGN="right" SRC="image.gif">

Aligning text with images

<IMG ALIGN="top" SRC="cleary.gif"> text text text
< IMG ALIGN="middle" SRC="cleary.gif"> text text text

<IMG ALIGN="bottom" SRC="cleary.gif"> text text text


Spaces

Creating a space type this in the code &nbsp
That thing is an ampersand command that creates a space as if you pushed the space bar.

To indent the Paragraph, type
& nbsp;&nbsp;&nbsp;&nbsp;&nbsp

A bullet to separate text
&#149;


Bullet Lists
I like lists with bullets and to do so you simply type:

<UL>
< LI>apples
< LI>oranges
< LI>bananas
< /UL>

The UL stands for Unordered List. It means bullets will be used rather than numbers.
LI stands for List Item. The /UL ends the entire list.

If you want different bullets, like squares type:

< UL TYPE="square">
< LI>apples
< LI>oranges
< LI>bananas
< /UL>


Number Lists
<OL>
< LI>List Item 1
< LI>List Item 2
< LI>List Item 3
< /OL>

The OL stands for Ordered List. It means numbers will be used rather than bullets.
LI stands for List Item. The /OL ends the entire list.

Roman Numeral Lists

<OL TYPE="I">
< LI>List Item 1
< LI>List Item 2
< LI>List Item 3
< /OL>

Capital Letters

<OL TYPE="A">
< LI>List Item 1
< LI>List Item 2
< LI>List Item 3
< /OL>


 


Links

Hyperlink to another web page
<A HREF="http://www.clare.k12.mi.us">Clare Public Schools</A>

A stands for Anchor. It begins the link to another page. The HREF stands for Hypertext REFerence. http://www.clare.k12.mi.us is the FULL ADDRESS of the link. Where it reads "Clare Public School" is where you write the text you want to appear on the page. /A ends the entire link command.

Link to a page within the same website.
<A HREF="sunshine.html">Sunshine page</A>

Email Link

<A HREF="mailto:jcleary@clare.k12.mi.us">Click Here to email Mrs. Cleary</A>

Change link colors
Click inside the body tags and type LINK=#ff00ff " >(type an empty space after the ")
ALINK="FF00FF" > This is for an active link
VLINK="FF00FF" > This is for a previously selected link.

To see more colors try Visibone.

Embedding sound

<EMBED SRC="cool.mp3" AUTOSTART="true" loop="true" hidden="true">
</EMBED>

REPLACE “COOL.MP3” WITH WHATEVER YOUR FILE IS CALLED.
If you don’t want it to loop than you can either replace loop=“true” with false or just take the whole loop part out. If you want to be able to pause, stop, and play your music than replace hidden= “false” with true!

Created by: Ricky Johnson