Pages

Thursday, August 30, 2012

Basic layout of HTML scripts. Head and Body Sections

HTML Head Section
The <head> tag is a part of basic structure of HTML documents. It is intended for keeping technical and some other data of web-page. These do not show on the screen (except for <title> tag).


Any of these tags is not required.

Examples
<head>
<title>Title of the page
</title>
</head>

It's a basic example of using <head> tag. On the picture you may see title of page, determined in <title> tag.

The HTML Body Section
When you create a blank HTML document, if the body section is left blank you will see nothing on the screen. The <body> tag is the central and most important part in an HTML document. In fact, it is needed to be able to see anything on the screen. While the header tag is important also, mostly every standard tag in HTML goes into the body. It is the core of the page.

The body tag can be used to control the background color of the document by setting the attribute "bgcolor" using a hex value (see the tutorial on Colors for details). You can add other attributes to control the link and text colors and they will be the defaults for the web page you are attempting to build. Additionally, you can set an image to become the background through the background attribute. For the image to load in all popular browsers, it is recommended to be in the jpeg format as it generally loads faster than gif or png images.

If image is not found or browser doesn't show pictures, image will not appeared. Background will have color which determines by "bgcolor" tag.

Here is an example of how you would set the background to be an image called “img01.jpg”, the black background color, white color of text and visited links, blue color for active links and disable scroll bars.

Examples
<body>
Content of the page
<body>

This example shows basic use of <body> tag.
<body background="img01.jpg" bgcolor="#000000" vlink="#ffffff" alink="#00008B" text="#ffffff" scroll="no">
Content of the page
</body>

As always, remember your basic tags and that should be the key to formatting. If you have it down, you should have no trouble building your web pages.

<html>
<head>
<title>
</title>
<meta name="keywords" content="">
<meta name="description" content="">
</head>
<body>

</body>
</html>

Remember with your body tag that you can customize it with the examples as seen above.

No comments:

Post a Comment