HTML Body Attributes
Tutorial
Remember this <body></body>?
It's time to add some attributes to the body of our webpage.
Add Color To Your Web Page
To add a background color to a webpage, you
add the attribute bgcolor=""
to the body tab, and stick your color of choice between the
quotation marks, like this:
<body bgcolor="#FFFFCC"></body>
Here's a nifty tool
for picking web-safe colors.
I'll get into the whole "web-safe color"
thing later on the graphics pages, but for now, suffice it to
say, I never bother with web-safe colors, but you should :-).
Adding Background Images To A Web Page
So far we've added color, suppose we'd like
image on the back of our page, instead. It looks like this:
<body background="images/background.gif"></body>
That means the background design on the
page is a graphic named background.gif
and it's in our image
folder. There'll be more info on
using web background images in the Web Graphics portion of this
site, but for now, you only need to know that:
A. Whatever image you use will repeat itself to fill up the
screen, so keep that in mind.
B. It's gotta be small size-wise so it loads quickly.
C. Background images can make a webpage real ugly, so use discretion.
Setting Margins
If you'd like your webpage flush against
the upper and left margins, you'll want to use the leftmargin
and topmargin attributes. Alternatively,
if you want your page to start down south or over to the right
some, these attributes are a way to get them there (note: there
are many ways to skin a cat in HTML, so this is just one of
them).
Personally, I only use these attributes set
at 0, so there won't be any excess margin space. In action,
it looks like this: <body leftmargin="0"
topmargin="0"></body>
But now let's rock our world by
moving on to hyperlinks
If you'd like us to alert you when new tutorials arrive,
join our email list (on the menu to the left)
You can email us at
Sorry, no individual questions answered,
though we may use yours as the basis for a new article.
©2007 www.WebsiteBeginner.com
|