Homepage

HTML lessons


Explaining simple tags
Explaining simple tags2
Explaining simple tags3
Browsers and Notepad
Playing with Fonts
Colors and Tags
Learning to Link
Inching through Images
Inching a Bit More with Images
Terrific Tables to Try
Building Borders
Wrapping Text
Terrific Tables Two
Color
Pat's Web Page
Making Lists Long and Short
The Mail Command
Basic Frames
Making Forms
Making More Forms
Making Buttons One
Making Buttons Two
IFrames
Appendix

COLORS AND MORE TAGS

If you are observant, you probably noticed the pages are given different colors. Sometimes the table is a separate color. The whole page can be set with a background color using the following commands:
<body bgcolor="#339900"> </body>
The ending body tag appears at the end of the page; there is no need to try to stick it in earlier. Besides the background color, I gave the table another color. It is given by the following command:
<table bgcolor=#ffffcc>
I can give the table cell a different color by similarly inserting the color command in the <td> tag.

Which brings us to the next point of the lesson. Tags are logically nested within each other. Html tags begin and end the page. "Nested" just inside the html tags are the next set of tags.
Your browser is always looking for the ending tag of the tag you most recently started. After that, it will look for the next closing tag for the command you gave before.

Clear as mud? Well, to try to do a bit better, take a look at the title.

<h1 align=center><i>COLORS<font color="#0066FF">AND</font> MORE <font color="#339900">TAGS</font></i></h1>

The entire title is surrounded by H1 tags. Since I choose to italicize the entire title, "nested" just inside these tags are the opening and closing italics tags.

And "nested" inside these tags are the color tags, beginning and ending.

Notice it is italicized. I put the italic command just before more and the ending tag just after tags. If I had not given it a closing tag, the browser would still be writing everything in italics.

There are a few tags that do not have to be closed. The two most often used are the paragraph tag and the break tag (p and br). Almost everything else needs to have a closing tag, or your browser will not know to stop that command.

Spaces that appear in Notepad will not appear in your browser unless you give it a proper tag. Codeslingers use the spaces in Notepad to more easily set and read the code. By putting commands on separate lines, the code is much easier to read.

And that's all I have to say about this. For now, anyway.