The Body Tag Explained>>

We've learned quite a bit about tables in the past few reviews and examples; we've learned how to properly code them and even a few attributes that can be used within them. Many users that first get into HTML dread trying to learn tables for the simple fact that they think they are complicated and hard to learn; they are actually the complete opposite. They are actually very easy to pick up and code, once a basic understanding of the layout of a table is acquired at least.

There are many more attributes that can be used with tables, but we're not going to go that far with them. We just needed to touch on tables and the basics of them, so we can get a better understand about them. Later on while playing with them, we may pick up a few more attributes and many can be found online by searching for "HTML tables". There are many free resources out there that explain more advanced features with tables and the attributes associated with them.

Instead of continuing with tables, we're going to move into other aspects of HTML. I'd like to move onto the body tag, remember this is the tag we use to start the content associated with our web page. There are quite a few different attributes we can use with the body tag and we'll go over a few now.

When using attributes within the body tag, we can adjust aspects of a web page on a global scale, meaning for the entire page and not just for one section. Most of these attributes that we'll use and go over can be used in other portions of a web page and code, so be sure to learn them as we will be using them again or we may have already used them once before.

The fist attribute we'll go over for the body tag, will be the color attribute. With the color attribute we can determine the entire background color for our web page, this is a good way to make sure that each user that visits the site, will view it the way we intended them to, or to totally customize the look and feel of the page. So let's take a look at an example of the color attribute in action.

Code Example

<BODY BGCOLOR="Black">

Now we can't show an example out put for this tag, as we have our own in place so our site is viewed correctly. But we can still get the idea and we can also see how it's properly coded. In this example the background of a page will be displayed in black. There is one other way we can use this attribute and that's with a color hex code, which we've already used once before, so it shouldn't be to hard to remember but let's take a look at an example using one.

Code Example

<BODY BGCOLOR="#00000">

Now with this example we used the same attribute, but we used a hex color code instead of a color name. There is more versatility with hex color codes, as there are an unlimited amount of colors that can be produced with them. There are quite a few "web safe" color charts all over the net that will show the web safe color and its hex code and many design applications have hex code generators built into them.

With the body attributes we can use what are called style tags which can change the color of certain aspects of our site, for instance we can change the color of all of the links within our web page. Using these attributes is a great way to add a theme or style to our site and they can be used site wide.

There are three attributes associated with the styling of links within our web pages. We have the “link” attribute, which is used to color the actual link itself within the web page. We also have two others that will change the color of the link if it’s active “alink” and if it’s been visited or clicked on “vlink”, with all three of these we can change the color of all the links contained within our web page. So let’s take a look at an example using all three of these link attributes.

Code Example

<BODY LINK=”#FFFFFF” ALINK=”#000000” VLINK=”#000000”>

In the above example we used all three of the link attributes and assigned colors for each one. This simple line of code will change the color of all the links within our page to white and it will also change the active and visited link colors to white. This is a great way to add color, customization and style to any web page.

Last but not least we have the image attribute, this image attribute is a way we can add an image to the web page as the background. This is very simple to do, so let’s take a look at an example of a body tag utilizing the background image attribute.

Code Example

<BODY BACKGROUND=”image.gif”>

That looks simple enough, doesn’t it?

There are many more attributes that can be used within the body tag, but these are the main ones and will most likely come in handy more then once. Remember to double check all code to insure proper syntax so browser will be able to display the page properly.


<< Back








   



MSN Nick Name



More Resources...





Most Viewed Services:
  1. HTML Tutorial
  2. XHTML Tutorial
  3. CSS Tutorial
  4. Javascript Tutorial
  5. DHTML Tutorial
  6. VB Script
  7. TCP/IP Tutorial
  8. ADO Tutorial
  9. MYSQL Tutorial
  10. ASP Tutorial
  11. AJAX Tutorial
  12. CFML Tutorial
  13. PHP Tutorial
  14. WML Tutorial
  15. FLASH Tutorial
  16. XML Tutorial
  17. RSS Tutorial
  18. SQL Tutorial
  19. HTML Articles
  1. Javascript Articles
  2. PHP Articles
  3. SEO Articles
  4. Web Design Articles
  5. SEO Tips
  6. Web Design Tips
  7. Articles
  8. CSS
  9. CSS Tips
  10. HTML Tips
  11. JAVASCRIPT Tips
  12. MYSQL Tips
  13. PHP Tips
  14. Money
  15. Tutorials
  16. Web Hosting



  • Home
  • Web Directory
  • Top Directoriers
  • Webmaster Directories
  • Contact
  • © Copyright 2006 All Rights Reserved By CodeDcode.Com