having background textures in your HTML pages couldn't be more simple. In fact, it's dead simple. Just a single line of code, and that's it, you're in business. Besides, textures can enhance your pages quite a lot.

Depending on the texture, sometimes you will probably need to change the colors of text and links. If you don't know how to do it, just read below.

below there's a sample code for an HTML page. The line concerning the background tag is the one in bold starting with <BODY. Of course, you must adapt the code to your needs by specifying the correct name for your texture file.

Textures can be either a JPG (JPEG) or a GIF image (still frame or animated). Try to use JPG images instead of GIFs. JPG files are usually much smaller.

From here, you can copy the code and then past it into your HTML editor. Just select the text with your mouse and copy it.

<HTML>

<HEAD>
<TITLE>Background texture example</TITLE>
</HEAD>

<BODY BACKGROUND="texture.jpg">

<H3>The quick brown browser jumps over the lazy texture.</H3>

</BODY>

</HTML>

this site is dedicated to background textures only. However, I strongly believe textures cannot be separated from background colors (remember, your texture can be transparent), nor from colors for text and for links. So it seems to me that it's a good idea to give you some notes about this. Ready?

Ok. Here we go. There are 5 HTML tags for handling colors. Take a look at the example below, specially those lines in bold starting with <BODY.

<HTML>

<HEAD>
<TITLE>Colors example</TITLE>
</HEAD>

<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#008080" ALINK="#FF0000" VLINK="#FF0000">

<H3>The quick brown browser jumps over the lazy texture.</H3>

</BODY>

</HTML>

The values inside the quotes are the colors. Colors must be specified using three two-digit hexadecimal numbers for Red, Green, and Blue content. The format for the digits is #RRGGBB.

The tags. Their names are almost self-explanatory. BGCOLOR is the background color. TEXT is the text color. LINK is the color of the link. ALINK means Active LINK (when the quick browser is trying to contact the lazy server...). And VLINK means Visited LINK (an already visited page).

You can mix those 5 tags in any order you wish. Furthermore, you don't need to specify them all. Only the ones you need or want. And yes, you still can include the BACKGROUND tag as well.

See? I told you this was dead simple.

front | main | how-to | about | contact
37798 | Copyright © 1995-2009 by Josť De Almeida | All Rights Reserved

Sites: knocking on the web's door