AlfieWebDevTips Homefor new and experienced developers
[Home Home] [Web Development Web Development ] [Code Generators Code Generators ] [Resources Resources ] [Contact Us Contact ] |WebDevTips Privacy Privacy |
Print This Page

You are here : Home - Web Development - HTML - Webpage building - tag attributes

Webpage building - tag attributes



For this part we are going to look at the <body> </body> tags, in particular the opening <body> tag.

The <body> tag tells the browser we want to start putting things onto the page.

BUT, what if we want things to appear differently? What if we want a different page color. What if we want to change the color of the text. How do we do that?

Well the answer is simple - tags have values attached to them which, if not specified, just use the browsers default settings but you can change them by learning what attibutes are assigned to each tag (not all tags have the same attributes).

For the <body> tag we can change the following document properties

  • page background color
  • text color
  • link color
There are more but that'll do for now.

The attribute used to change the background color of the page in the <body> tag is bgcolor="value". Color values can either be a color name i.e bgcolor="red" or a value bgcolor="#ff0000" (always use the # when using values also be careful when using color names - not all browsers recognise all the names)

We now have a <body> tag that looks like this

<body bgcolor="red">

OK let's make it even uglier :) how about making the text on the page yellow (argh!) The attribute used to do this is text="value" (the same applies to all colors as explained above) so our <body> tag now loks like this

<body bgcolor="red" text="yellow">

Hopefully you can now start to see how easy it is to change things so they look the way you want them to.

You might want to check out this page for a full list of html 4 tags and attributes

In part 4 we'll take a look at some basic text formatting tags.



Part 01 - the basics
Part 02 - the structure
Part 03 - tag attributes
Part 04 - text formatting tags

Why not discuss this article in our forum?
Other related guides : file structure | forms | lists







Google
 

[back to top of page]   

[labelled with icra -  - this link will open in a new window] [RSS Content]

[Copyright © WebDevTips]