<BODY BGCOLOR=#hex_number>
In order to change a particular color, you must find out the RGB (red, green,
blue) hexadecimal (base=16) value for the color you
want. There are a number of programs that will give the RGB hexadecimal value
for a particular color. For example, Colormeister on the MAC.
The numbers range from
00 00
00
being black (lack of color) to
FF FF
FF
being white (all colors) to
being white (all color).
Example:
<BODY BGCOLOR=#6BE138>
Exercises
<BODY BACKGROUND="image_file">
Example:
Making a background out of the graphic file "jeweled.gif":
<BODY BACKGROUND="jeweled.gif">
Example:
TEXT=#hex_number
- TEXT controls the color of the all the document's body text that is not a link, including headings and body text. (Default is black)
LINK=#hex_number
- LINK controls the color of unfollowed links. (Default is blue)
VLINK=#hex_number
- VLINK controls the color of visited links. (Default is purple)
ALINK=#hex_number
- ALINK controls the color of links that have had the mouse button pressed on it, but not released. (Default is red)
<BODY BGCOLOR=#008080
TEXT=#FFFFFF
LINK=#FFFF00
VLINK=#00FF00
ALINK=#008080>
<FONT [SIZE=number] [Color="#RRGGBB"] [FACE="facename"]>text string</FONT>You may specify the text to be smaller to larger by using the SIZE=number option in the font tag. The values of SIZE are 1 to 7, with three being the default size.
The COLOR attribute allows you to change the color of the text.
The FACE attribute specifies the typeface to be used, such as Arialor Courier. If multiple names are specified, the first one listed that is installed on the client machine is used.
Example:Note:This is normal, black text.
<FONT SIZE=4 COLOR="#FF0000" FACE="Arial">This is larger, red text displayed in arial typeface</FONT>
ALIGN
attribute is used to specify the alignment of a text element.
ALIGN={LEFT|CENTER|RIGHT}
ALIGN may be set to LEFT, CENTER, or RIGHT in order to make the text left
justified (default), centered, or right justified, respectively.
ExercisesExamples:
<P ALIGN=CENTER>
This section describes some additional options
<BR>(called attributes) for some of the markup tags that where
<BR>discussed in the HTML Basics class, plus introduces some
<BR>additional markup tags.</P><P ALIGN=RIGHT>
This section describes some additional options
<BR>(called attributes) for some of the markup tags that where
<BR>discussed in the HTML Basics class, plus introduces some
<BR>additional markup tags.</P>
<H2 ALIGN=CENTER>This is the title of my Page</H2>
<CENTER>text and/or images</CENTER>
Examples:
<CENTER>
Click to see results
This section describes some additional options
<BR>(called attributes) for some of the markup tags that where
<BR>discussed in the HTML Basics class, plus introduces some
<BR>additional markup tags.
</CENTER>
<IMG SRC="graphics file URL" [ALT="text"]
attributes>
Some additional attributes include:
ALIGN="{TOP | MIDDLE | BOTTOM | LEFT | RIGHT}"
- This causes the top, middle, or bottom of the image to be aligned with the text on the line containing the
IMG
tag. These attributes treat the image like text. ALIGN can also beLEFT
orRIGHT
, this anchors the image to the left or right of the screen and forces text to flow around it. (Default isBOTTOM
.)WIDTH=number
- This specifies the width (in number of pixels) of the image.
HEIGHT=number
- This specifies the height (in number of pixels) of the image.
BORDER=number
- Here number is the border thickness in pixels. (Default=1)
ISMAP
- This attribute indicates that this image is a server-side image map.
USEMAP
- This attribute is used for client-side image maps.
HEIGHT
and WIDTH
attributes allow the browser
to know the dimensions
of the image enabling the browser to
format the display the document text, before the
image has downloaded.
ALIGN={LEFT|RIGHT}
, you may need to use
<BR CLEAR={LEFT|RIGHT|BOTH}>
to get the intended spacing.
ExercisesExamples:
This is a picture of the Statue of Liberty
<IMG SRC="statue_liberty.gif"> (located in New York harbor) on a cloudy day. For many immigrants, this was a most welcome site.
This is a picture of the Statue of Liberty
<IMG SRC="statue_liberty.gif" ALIGN=TOP BORDER=5> (located in New York harbor) on a cloudy day. For many immigrants, this was a most welcome site.
<IMG SRC="statue_liberty.gif" ALIGN=LEFT> Not like the brazen giant of Greek fame With conquering limbs astride from land to land; Here at our sea-washed, sunset gates shall stand A mighty woman with a torch, whose flame Is the imprisoned lightning, and her name Mother of Exiles. <br> From her beacon-hand Glows world wide-welcome; her mild eyes command The air-bridged harbor that twin cities frame, <br> " Keep, ancient lands, your storied pomp ! " cries she With silent lips. " Give me your tired, your poor, Your huddled masses yearning to breathe free, The wretched refuse of your teeming shore, Sende these, the homeless, tempest-post to me, I lift my lamp beside the golden door ! " <P> by Emma Lazarus, New York City, 1883
Click to see results
Click to see results, adding: <BR CLEAR=LEFT>
<IMG SRC="statue_liberty.gif" ALIGN=RIGHT WIDTH=57 HEIGHT=123> This is a picture of the Statue of Liberty (located in New York harbor) on a cloudy day. For many immigrants, this was a most welcome site. <BR CLEAR=RIGHT> " Give me your tired, your poor, Your huddled masses yearning to breathe free, The wretched refuse of your teeming shore, Sende these, the homeless, tempest-post to me, I lift my lamp beside the golden door ! "
<SUB>
text</SUB>
The subscript tag defines text that should be displayed in a smaller font than usual and lower on the line than usual.
Example:
<P>To test the hypothesis that two proportions are the same, one would test the following null hypothesis </P>
<P>H<sub>0</sub>: p<sub>1</sub> = p<sub>2</sub> = p</P>
<SUP>
text</SUP>
The superscript tag defines text that should be displayed in a smaller font than usual and higher on the line than usual.
Example:
<P> Albert Einstein's famous formula: E=mc<SUP>2</SUP>. </P>
Transparency and Interlacing are both features of the GIF89a format. Neither JPEG nor older GIF87 files have these capabilities.
Transparency is the capability to set a color in a GIF file to be invisible. Therefore, when you display the image on a WEB page, the page beneath the image will show through the transparent parts. You can only make one color in the image transparent.
The following example shows the same image twice. The first does not have a transparent background while the second's background has been set to transparent.
Click to see the differenceComments:
Interlacing is a method for saving GIF images. Instead of saving the file linearly (line 1, line 2, ... last line), an interlaced GIF file is saved in a stepwise fashion.
When the interlaced GIF file is displayed, the rows are loaded in the same sequence in which they were saved. Using Netscape, the missing lines are filled in with the information from the initial lines, thereby creating a blurry look until all the lines are filled in.
Interlacing is great for large images that take a long time to load. The visitor to your site will be able to more quickly get an idea of what the image will look like. That way the visitor can elect to stop loading the image if they are not interested.Example of a non-interlaced GIF. Example of an interlaced GIF.
An image map is an image that contains context sensitive links. This allows a number of different links associated with it. Coordinates of mouse clicks are sent to either the browser or the web server and then tranlated into URL's. Clicks on different portions of the image go to different links. There are two types of image maps: Client-Side and Server-Side.
Client browsers handle the image map coordinates, therefore they can process the image map faster. Netscape 2.0 is one of the browsers that supports this type of image map.
The map tag defines a client-side image map. It gives a name to a collection of AREA tags that are superimposed over an inline image to connect user clicks with URLs.
<MAP NAME="name"> area tags </MAP>
The <AREA> tag, valid only within a MAP, defines areas that act as hotspots within an image. There is no default or "background" area; you can achieve this effect by including an AREA tag at the end of the map that encompasses the entire image.
<AREA SHAPE="{RECTANGLE|CIRCLE|POLYGON}" COORDS="coords" HREF="URL">
The SHAPE attribute can be one of RECTANGLE, CIRCLE, or POLYGON (each can be abbreviated to the first four letters.)
The COORDS attribute gives the co-ordinates, in pixels, measured from the upper left corner of the image, of the defining points for the shape. For RECTANGLE these are left, top, right, bottom. For CIRCLE they are Xcenter, Ycenter, radius. For POLYGON they are x1, y1, x2, y2, ... xn, yn.
Example:<Center> <IMG SRC="clickmap.gif" USEMAP="#newmap" BORDER=0 WIDTH=361 HEIGHT=233> <MAP NAME="newmap"> <AREA SHAPE="RECT" COORDS= "145,32,228,109" HREF="square.html"> <AREA SHAPE="CIRCLE" COORDS= "82,168,44" HREF="circle.html"> <AREA SHAPE="POLY" COORDS= "214,199,320,199,320,90" HREF="triangle.html"> <AREA SHAPE="RECT" COORDS= "0,0,361,233" HREF="miss.html"> </MAP> </CENTER>
All browsers that can display images support server-side image maps.
<A HREF="image map"> <IMG SRC="image map graphic" ISMAP attributes > </A>
The "image map", saved with the .MAP
extension, defines the
areas that act as hotspots within an image. Like Client-Server Image Maps,
the hotspots can be either a RECTANGLE, CIRCLE, or POLYGON (which can be
abbreviated to the first four letters.) Unlike Client-Server Image Maps,
you can define a default area.
The hotspots are defined in pixels. For RECTANGLE these are left,top right,bottom. For CIRCLE they are xcenter, ycenter xperiphery,yperiphery. For POLYGON they are x1, y1 x2, y2 .. xn, yn x1,y1.
Example:Exercises<Center> <A HREF="clickmap.map"> <IMG SRC="clickmap.gif" BORDER=0 ISMAP WIDTH=361 HEIGHT=233> </A> </CENTER>whereclickmap.map
contains:default /path/miss.html rect /path/square.html 146,33 227,110 circle /path/circle.html 86,168 86,125 poly /path/triangle.html 320,95 319,200 215,200 320,95
The basic format for all tables looks like this:
<TABLE> <CAPTION>Caption Text</CAPTION> <TR> <TH>Cell Contents</TH> ... </TR><TR> <TD>Cell Contents</TD> ... </TR>...</TABLE>
Example: Simple Table<TABLE BORDER> <CAPTION>Simple Table</CAPTION> <TR> <TD>One</TD> <TD>Two</TD> <TD>Three</TD> </TR> <TR> <TD>Four</TD> <TD>Five</TD> <TD>Six</TD> </TR> </TABLE>
The BORDER
attribute causes the table and all cells
to be surrounded by a raised border.
Example: Simple Table without a BorderExercises<TABLE> <CAPTION>Simple Table</CAPTION> <TR> <TD>One</TD> <TD>Two</TD> <TD>Three</TD> </TR> <TR> <TD>Four</TD> <TD>Five</TD> <TD>Six</TD> </TR> </TABLE>
As shown in the previous section, the optional <CAPTION>
tab is used to label tables. The <CAPTION>
tag also has
an alignment attribute that allows the caption to be placed above or below
the table. The default alignment is TOP
.
Exercises
<CAPTION [ALIGN={TOP|BOTTOM}]>Caption Text</CAPTION>
The <TH></TH>
tag centers and presents the enclosed
text in boldface.
Example: Headers As Column LabelsExercises<TABLE BORDER> <TR> <TH>Header 1</TH> <TH>Header 2</TH> </TR> <TR> <TD>Cell Content 1</TD> <TD>Cell Content 2</TD> </TR> <TR> <TD>Cell Content 3</TD> <TD>Cell Content 4</TD> </TR> </TABLE>Example: Headers As Row Labels<TABLE BORDER> <TR> <TH>Header 1</TH> <TD>Cell Content 1</TD> <TD>Cell Content 2</TD> </TR> <TR> <TH>Header 2</TH> <TD>Cell Content 3</TD> <TD>Cell Content 4</TD> </TR> </TABLE>
Spanning allows a cell to occupy the space of several cells. Spanning may occur in both horizontally or vertically.
Example: Row SpanningExercises<TABLE BORDER> <CAPTION>Row Spanning</CAPTION> <TR> <TD ROWSPAN=3> </TD> <TD>Red Team</TD> <TD>Blue Team</TD> </TR> <TR> <TD>3</TD> <TD>7</TD> </TR> <TR> <TD>5</TD> <TD>2</TD> </TR> <TR> <TD>Total</TD> <TD>8</TD> <TD>9</TD> </TR> </TABLE>Example: Column Spanning<TABLE BORDER> <CAPTION>Column Spanning</CAPTION> <TR> <TD COLSPAN=3>Regional Teams</TD> </TR> <TR> <TD>Red</TD> <TD>Blue</TD> <TD>Green</TD> </TR> <TR> <TD>Yellow</TD> <TD>Orange</TD> <TD>Purple</TD> </TR> </TABLE>Example: Row and Column Spanning<TABLE BORDER> <CAPTION>Combinations</CAPTION> <TR> <TD ROWSPAN=3> </TD> <TD COLSPAN=2>1996 Season Standings</TD> </TR> <TR> <TD>Red Team</TD> <TD>Blue Team</TD> </TR> <TR> <TD>First</TD> <TD>Second</TD> </TR> <TR> <TD>Total Points</TD> <TD>34</TD> <TD>32</TD> </TR> </TABLE>
<TR [ALIGN={LEFT|CENTER|RIGHT}]> <TD></TD> ... </TR>or
<TD [ALIGN={LEFT|CENTER|RIGHT}]></TD>
Exercises<TR [VALIGN={TOP|MIDDLE|BOTTOM}]> <TD></TD> ... </TR>or
<TD [VALIGN={TOP|MIDDLE|BOTTOM}]></TD>Example:
<TABLE BORDER> <TR> <TD> </TD> <TH>Alignment Attributes</TH> <TH>Alignment Attributes</TH> <TH>Alignment Attributes</TH> </TR> <TR> <TH>Horizontal<br>Alignment</TH> <TD ALIGN=LEFT>ALIGN=LEFT</TD> <TD ALIGN=CENTER>ALIGN=CENTER</TD> <TD ALIGN=RIGHT>ALIGN=RIGHT</TD> </TR> <TR> <TH>Vertical<br>Alignment</TH> <TD VALIGN=TOP>VALIGN=TOP</TD> <TD VALIGN=MIDDLE>VALIGN=MIDDLE</TD> <TD VALIGN=BOTTOM>VALIGN=BOTTOM</TD> </TR> </TABLE>
It is a simple process to insert a graphic into a table. Just enter
the IMG
tag between the <TD></TD>
tags.
<TABLE BORDER> <TR> <TD><IMG SCR="welsmall.gif" width=55 height=48></TD> <TD>Page Created by: VCU WebMaster<br>April 1, 1996</TD> </TR> </TABLE>
Exercises<TABLE BORDER> <TR> <TD><IMG SRC="welsmall.gif" width=55 height=48></TD> <TD>Page Created by: <a href="mailto:webmaster@www.vcu.edu">VCU WebMaster</a> <br>April 1, 1996</TD> </TR> </TABLE>
<TABLE BORDER> <TR> <TD> <UL> <LI>Item 1 <LI>Item 2 <LI>Item 3 </UL> </TD> <TD> <OL> <LI>Item 1 <LI>Item 2 <LI>Item 3 </OL> </TD> </TR> </TABLE>
Top<TABLE BORDER> <TR> <TD>Row 1/Cell 1</TD> <TD>Row 1/Cell 2</TD> </TR> <TR> <TD>Row 2/Cell 1</TD> <TD><table border> <tr> <td>Row 1/Cell 1</td> <td>Row 1/Cell 2</td> </tr> <tr> <td>Row 2/Cell 1</td> <td>Row 2/Cell 2</td> </tr> </table></TD> </TR> </TABLE>