Pages

Thursday, October 28, 2010

Head And Body

So now you know how to make a basic HTML page, complete with links and images. But what about all those little tricks that make a page really cool? Like, for example, the title.
Look up at the top of your screen. See how, across the top of the browser window, it says Xentrik | HTML | Body? That's a title. And this is how you do it. Remember the two tags with which you should start every HTML page:
<html>
<body>
Well between those we put header tags, and between those we put title tags, and between those we put the title.
<html>

<head>
<title>Title Goes Here</title>
</head>
<body>
See how it works? The <head> tag defines information about the page, like the title, while the <body> tag defines the actual content, like the text and images.
The body can do more, too. It can assign different colors to the text, links and background of your page. Just add those attributes to the tag, like this:
<body text="blue" link="red" alink="green" vlink="black" bgcolor="gray">
According to the line of code above, your text will be blue and your links will be red. An active link, one which is being clicked, will be green. A link you've already visited will be black, and the background color will be gray. You can also assign an image to be in the background, like so:
<body background="image.jpg">
"Image.jpg" will repeat so that it covers the entire background of your page, even if it scrolls. If you want your background to be fixed so that it doesn't scroll with the text, add bgproperties="fixed" to the <body> tag.
Another thing the <body> tag can do is assign the width and height of the margins around the page. Notice how, on this page, the images and text go right to the edges of the browser window. You can do this to your page with this:
<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">

0 Comments:

Post a Comment