Tuesday, 28 June, 2022


Webmaster Tools

single post

  • Home
  • BODY tag attributes

BODY tag attributes

Adding BODY tag attributes, e-mail links and linking within a single page


When we discussed about links and <BODY> tag in the beginning of our tutorial we didn’t cover all the format of these commands. We didn’t want to put a lot of information for you in our first tutorials. We’ll discuss more about these commands in this tutorial:

<BODY> … </BODY>

This command has lots of attributes that can be used to specify the main document characteristics. Below is a brief explanation of each attribute:

BGCOLOR=”color hex code|color” – specifies the background color of your page. The default setting is usually white or gray. Just type in a color name or hex code.

TEXT=”color hex code|color” – this attribute changes the default text color to the color that you would like to use.

LINK=”color hex code|color” – specifies the color of all of the non-visited links on your HTML document.

VLINK=”color hex code|color” – this attribute changes the color of visited links on your page.

ALINK=”color hex code|color” – this changes the color of an active link on your HTML document, which is a link that has just been clicked on by a user’s mouse.

BACKGROUND=”image.gif” – this attribute specifies the background image that will be used as your HTML document background.

If you want to put an e-mail link on your HTML document, you have to use the standard e-mail link tag. Use “mailto:” rather than “http://”, and after the “mailto:” use your e-mail address rather than a web address, like this:

<A HREF=”mailto:your_email_address”>E-mail me</A>

Here is the resulting link:

E-mail me

Of course, you’ll have to replace your_email_address with your real e-mail address.
If you click on the link, your e-mail program will start with the e-mail address already filled in.
You can also create the subject of the message so the visitor doesn’t have to fill in something in the subject line. You do this like this:

<A HREF=”mailto:your_email_address?subject=Hello”>E-mail me</A>

The subject field of your e-mail message will be filled in with “Hello”. Replace “Hello” with whatever e-mail subject you want.

You can also add a carbon copy recipient (cc=email_addresses_separated_with_commas), a blind carbon copy recipient (bcc=email_addresses_separated_with_commas), or use a combination of the subject with either or both of these. If you want to combine more than one of the commands, add “&” sign between the commands. Examples:

<A HREF=”mailto:your_email_address?cc=your_friend_email_address”>E-mail me</A>

<A HREF=”mailto:your_email_address?subject=Hello&cc=email”>E-mail me</A>

If you have a page that is pretty long you can link from one part of the page to the other part of the page. For example, from the bottom of your page to the top of the page. An additional attribute named anchor <A NAME=”name”>optional text</A> is used to specify the area of your page you want to make a link to. Place any name you wish inside the quotes. Now, go to any part of the page and type this link:

<A HREF=”#name”>Link to the other part of the same HTML document</A>

The # sign is there to let the browser know the destination is a named anchor. If you create an anchor named “top”, you link to that anchor by using “#top”.
You can even specify the named anchor when linking from any other HTML document to the one with a named anchor like this:

<A HREF=”basic.html#name”>Link to the “basic.html” page with the anchor named “name”</A>

So, let’s move on to the next section Special characters.

Recent Comments

No comments to show.