HTML <HEAD> Element
The<head> element is just a container for all other header elements. It is the first thing to appear after the opening of the <html> tag.
The <head> tag has it’s closing tag also which ends above the starting of the <body> tag, and each and every <head> tag content the <title> element to indicate the title of the web page on the title bar.
Inside the <head> element there we can use some more elements which are following…
- <base> – This transforms the relative URL into a full absolute URL. This element allows you to specify a base URL for a page.
- <style> – The style element includes the CSS rules.
- <meta> – Which include the information about the document such as keywords and description which are particularly helpful for the search. This will web page for better search engine optimization.
HTML Body Tag
The tags used to indicate the start and end of the main body of textual information are:
<body>//starting body tag.
</body>//closing of body tag.
Page defaults like background color, text color, font size, font weight and so on can be specified as attributes of the <body> tag. The attributes of that the <body> tag are given.
- Bgcolor: Change the default background color whatever color is specified on it. We can define color as a hexadecimal value (#fff) or color name. (white, red, blue, etc).
- Background: Specifies the name of picture file like as Gif file that will be used as the background of the document.
- Text: Change the body text color from its default value to the color specified by this attribute.
|BACKGROUND||Specifies an image to repeat as the background of the page|
|BGCOLOR||Specifies a color to use as the background for the page|
|TEXT||Specifies the color of use as the default color for the text|
|LINK||Specifies the color to use for the link that has not been clicked|
|VLINK||Specifies the color to use for the link that has been clicked|
<body bgcolor='#ff0000'> or <body bgcolor='red'>
While changing the background as an image, the image file should be present in the current working directory. If not relative path should be specified to where the image file exists.
<body text='black'> or <body text='#000000'>