Body HTML Code Modifiers

From Lunarpages Web Hosting Wiki

Jump to: navigation, search

There are several HTML tags that can act as modifiers to how the web page looks visually.

First, let us re-visit the body tags. The body tags are there to tell the browser what part of the document is going to be visible to the end user when viewing the web page. This is marked up in your HTML code by putting a <body> where your web page's content begins and a </body> tags where it ends.

Contents

How to Modify the Body Tag

So, any time you modify the body tags, you will be changing the way the web site is seen. There are several body tag modifiers you can use.

Change the Web Page's Background Color

You can add bgcolor="VALUE" (replacing VALUE with the name of the color or the HEX number) to change the background color for a web page.

Code: <body bgcolor="white"> (this would make the background all white)

Change the Web Page's Text Color

You can add text="VALUE" (replacing VALUE with the name of the color or the HEX number) to change the background color for a web page.

Code: <body text="black"> (this would make the text all black)

Change the Web Page's Link Color

You can add link="VALUE" (replacing VALUE with the name of the color or the HEX number) to change the color of links on a web page.

Code: <body link="blue"> (this would make the links all blue)

Change the Web Page's Visited Link Color

You can add vlink="VALUE" (replacing VALUE with the name of the color or the HEX number) to change the color of link that have already been visited on a web page.

Code: <body vlink="red"> (this would make the visited links red)

Change the Web Page's Active Link Color

You can add alink="VALUE" (replacing VALUE with the name of the color or the HEX number) to change the color of an active link.

Code: <body alink="purple"> (this would make the active link purple)

More Helpful Body Tag Tips

You can use more than one of these at a time. If you wanted to, you could use more than one of these body modifiers at a time. you would just need to remember to put a space in between each body modifier. For example:

<body bgcolor="black" color="white">

This is how you would link more than one together, this would tell the browser to make the background of the web page black and the text on the web page white. There is no limit to the number of these modifiers you can use on the body tag, as long as everything is formatted correctly, the web page should come out the way you want it to.

Only add these modifiers to the opening body tag. It is important to note that you only add these modifiers to the opening tag <body> and not the closing tag </body>.

Where can I find the HTML color or HEX values? You can find these many places. One of the best examples, is on w3school.com's HTML colors page here:

What Have You Learned About Body HTML Code Modifiers?

Now, take a look back at what this page has taught you:

  • Elements can be added to the <body> tag to change the appearance of your web site.
  • bgcolor="VALUE" changes the background color on a page
  • text="VALUE" changes the text color on a page
  • link="VALUE" changes the link color on a page
  • vlink="VALUE" changes the visited link color on a page

Web Design Tutorial Navigation

Previous Web Design Tutorial:

Next Web Design Tutorial:

Share |
Want to read this in another language?
Personal tools