PageTutor.com - HTML Tutorials

To keep things a little cleaner I am only going to write what is in the <body> tags. I will omit the <html>, <head> & <title> tags. Needless to say, keep these in your document.

<body>
</body>

Type something really cool.

<body>
Something really cool
</body>

Something really cool


IMPORTANT NOTE: Whenever you make a change to your document, just save it, then hit the Refresh/Reload button on your browser. In many instances just hitting the refresh button doesn't quite do the trick. In that case...
 
   Internet Explorer users: Click Refresh while holding down the CTRL key.
   Netscape users: Click Reload while holding down the SHIFT key.

I think the first thing we are going to learn is how to change background colors.

<body bgcolor="#ccffcc">
Something really cool
</body>

Something really cool

ccffcc is computerese for light green. Here are a few more.

The topic of colors and browsers is rather interesting. Although it's not overly important to understand how browsers and colors work together at this point in time, you may want to come back to this section after the lessons and learn about Netscape's infamous 216 colors.


You can specify a background image instead. (Note, the image should be in the same folder as your HTML file. More on this below.)

<body background="swirlies.gif">
Something really cool
</body>

Something really cool

Here's the background image

In order for the image to show up, the browser has to be able to find it. For now, we want the image to be in the same folder as your HTML document (page1.html). The easiest way to do this is to right click on the swirlies image above and choose Save Image As (or some variant thereof). Browse to wherever you put page1.html and save the image there. Later we'll get into this stuff in a little more detail.


It's probably pretty obvious that the image is tiled. If you use a long skinny image you can get an effect like this...

<body background="bluebar.gif">
Something really cool
</body>

Something really cool

Here's the background image

 
FAQ: I've seen pages where the background is fixed and the page just scrolls over it. How can I do that?

A: Simple... add  bgproperties="fixed"  to the <body> tag...
<body background="mybackground.gif" bgproperties="fixed">
Keep in mind this little doodad is Internet Explorer specific. That is, only people using Internet Explorer or IE based browsers will be able to see it. This should cover most of your viewers. Here is an example.

Here is a good place to interject my thoughts on a hotly debated subject: A more modern and "proper" method for achieving a fixed background is done using CSS (Cascading Style Sheets). Actually, a case could be made that a LOT of traditional HTML markup can (and should) be made using CSS. But CSS is a lesson for another day. We crawl before we walk, walk before we run, blah blah blah. Today we're learning the basics.... simple, old fashioned HTML markup. So, carry on....

<< BACK         NEXT >>
pagetutor.com

QUICK SITE GUIDE

"Live as if you were to die tomorrow. Learn as if you were to live forever."
- Mahatma Gandhi