To specify blue as the background color for a page, put bgcolor=“blue” inside the tag. Of...

9
Custom Backgrounds and Colors

Transcript of To specify blue as the background color for a page, put bgcolor=“blue” inside the tag. Of...

Page 1: To specify blue as the background color for a page, put bgcolor=“blue” inside the tag. Of course, you can use many colors other than blue. You can choose.

Custom Backgrounds and Colors

Page 2: To specify blue as the background color for a page, put bgcolor=“blue” inside the tag. Of course, you can use many colors other than blue. You can choose.

Background and Text Colors

To specify blue as the background color for a page, put bgcolor=“blue” inside the <body> tag. Of course, you can use many colors other than blue. You can choose from the 16 standard Windows colors.

You can also call magenta by the name fuchsia and cyan by the name aqua if you want to feel more artsy and less geeky.

Page 3: To specify blue as the background color for a page, put bgcolor=“blue” inside the tag. Of course, you can use many colors other than blue. You can choose.

Background and Text Colors

You can also specify colors for text and links in the <body> tag. For example:• <body bgcolor=“teal” text=“fuchsia”

link=“yellow” vlink=“lime” alink=“red”> There are three separate attributes for link

colors:• link – “yellow” makes links that haven’t been

visited recently yellow.• vlink – “lime” makes recently visited links lime

green. • alink – “red” makes links briefly blink red when

some clicks them.

Page 4: To specify blue as the background color for a page, put bgcolor=“blue” inside the tag. Of course, you can use many colors other than blue. You can choose.

Creating Custom Colors If the 16 colors don’t include the

exact hue you’re after, you can mix your own custom colors by specifying how much red, green and blue light should be mixed into each color.

The format is #rrggbb where rr, gg, and bb are two-digit hexadecimal values for the red, green and blue components of the color.

Page 5: To specify blue as the background color for a page, put bgcolor=“blue” inside the tag. Of course, you can use many colors other than blue. You can choose.

Creating Custom Colors Just remember that ff is the

maximum and 00 is the minimum, and use of the following codes for each component:• ff means full brightness• cc means 80 percent brightness• 99 means 60 percent brightness• 66 means 40 percent brightness• 33 means 20 percent brightness• 00 means none of this color component

Page 6: To specify blue as the background color for a page, put bgcolor=“blue” inside the tag. Of course, you can use many colors other than blue. You can choose.

Creating Custom Colors For example, bright red is

#ff0000,dark green is #003300, bluish purple is #660099, and medium gray is #999999.• <body bgcolor=“#ff0000” text=“#003300”

link=“#660099” alink=“ffffff” vlink=“#99999”>

You can also use hexadecimal color codes in the <font> tag.

Page 7: To specify blue as the background color for a page, put bgcolor=“blue” inside the tag. Of course, you can use many colors other than blue. You can choose.

Creating Custom Colors Keep in mind that even though you can specify

millions of different colors, some computers are set to display on the 16 named colors. Other computers only reliably display 216 colors in the color code.

You should be aware that different computer monitors may display colors in very different hues.

The moral of the story: Stick to the named colors and don’t waste time mucking with hexadecimal color codes, unless you have precise control over your intended audience’s computer displays and to be safe, do test your page on different monitors if possible.

Page 8: To specify blue as the background color for a page, put bgcolor=“blue” inside the tag. Of course, you can use many colors other than blue. You can choose.

Background Image Tiles Background tiles let you specify an image

to be used as wallpaper pattern behind all text and graphics in a document. You put the image filename after the background= in the <body> tag at the beginning of your page.• <body background=“image.jpg”>

Like other Web graphics, background tiles must be in either the GIF or JPEG file format.

Page 9: To specify blue as the background color for a page, put bgcolor=“blue” inside the tag. Of course, you can use many colors other than blue. You can choose.

The <body> Tag Attributes Covered

Tag Attribute Functions<body>…</body> Encloses the body (text and

tags) of the HTML document

background=“…” The name or address of the image to tile on the page background

bgcolor=“…” The color of the page background

text=“…” The color of the page’s text

link=“…” The color of unfollowed links

alink=“…” The color of activated links

vlink=“ The color of followed links