|
Virginia's HTML—Colors |
Let's add some color. So far you've got default black text on a default white background. In printing, color adds substantial costs, so we've learned to accept black and white. On the web, color's free, so we should never accept black and white.
First, though, we'll be using hexadecimal numbers to specify our colors, so that's our first topic.
| Hex | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F | 10 | 11 | . . . | FF |
| Decimal | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | . . . | 255 |
You can use either upper or lowercase letters for the digits "A" through "F".
The same trick works for hex digits. The first two digits are red, the middle two are green and the last two are blue.
RR * 10000 = RR0000
GG * 100 = GG00
BB = + BB
-------
RRGGBB
A hex number in HTML is preceded by the "#" sign. To get maximum green, and nothing else, you would specify #00FF00. To get white you max out everything: #FFFFFF. To get a pale blue, you'd max out the blue, but back off a little on the other two: #E0E0FF. The following table shows some common values.
| #FFFFFF | #FF0000 | #00FF00 | #0000FF | #000000 | #FFFF00 | #FF00FF | #00FFFF | #404040 | #808080 | #C0C0C0 | #E0E0FF |
| white | red | green | blue | black | yellow | magenta | cyan | near black |
boring gray |
lighter gray |
light blue |
Let's consider some of these. The first eight use either the maximum amount of a color, #FF, or none of the color, #00.
For examples:
| <BODY BGCOLOR=#F8FCFF> |
What color is #F8FCFF? That's near maximum red (F8), even nearer maximum green (FC) and absolutely maximum blue (FF). Here's virginia.html with that light blue body color.
This is Virginia's first web page.This is Virginia's first web page.This is Virginia's first web page.This is Virginia's first web page.This is Virginia's first web page.This is Virginia's first web page. |
Now it's your turn. Set your own background color for virginia.html. Try different things: darker, lighter, more blue, more green. Get one that you like and then we'll go to work on the fonts.
| . . . <FONT COLOR=#000044>Virginia</FONT>'s . . . |
With that change, mine looks like this.
This is Virginia's first web page.This is Virginia's first web page.This is Virginia's first web page.This is Virginia's first web page.This is Virginia's first web page.This is Virginia's first web page. |
I like that effect. It's unobtrusive; almost subliminal. It emphasizes "Virginia" just slightly.
Add some color to the background — <BODY BGCOLOR=#??????>. Add some color to some of the text—<FONT COLOR=#??????>. . .</FONT>. Replace some of those stupid headings with actual headings and content and then upload to your site. I'm looking forward to seeing what you create.
Tomorrow I'll add a page about lists. These are lists.
This is an unordered list.
|
This is an ordered list:
|