Sunday, August 08, 2010

<body> Tag

Previously, I discussed about the basic tags used in HTML. And one of those tags is the Body Tag. Remember that the body tag holds the contents of your webpage. It contains the information that is shown on the browser. This is the most essential part of the code. Well, every tag used in HTML does contain attributes, or shall we say, properties. These properties define certain objects seen on the browser. It helps improve appearance of your webpage.

<html>
<head>
<title>Title of the Webpage</title>
</head>
<body>
Document contents…
</body>
</html>
 
Standard Attributes
 
Attribute
Value
Description
class classname Specifies a classname for an element
dir rtl
ltr
Specifies the text direction
id id Specifies a unique id for the element
lang language code Specifies a language code for the content of the element
style style definition Specifies an inline style for an element
title text Specifies extra information about the element
xml:lang language code Specifies a language code for the content in an element, in XHTML documents
 
 Optional Attributes
 
Attribute
Value
Description
text
#xxxxxx
rgb(x,x,x)
colorname
Specifies the default color of the text in a webpage
link
#xxxxxx
rgb(x,x,x)
colorname
Specifies the default color of unvisited links in a webpage
alink
#xxxxxx
rgb(x,x,x)
colorname
Specifies the color of an active link in a webpage
vlink
#xxxxxx
rgb(x,x,x)
colorname
Specifies the color of the visited links in a webpage
bgcolor
#xxxxxx
rgb(x,x,x)
colorname
Specifies the background color of a webpage
background
URL
Specifies a background image in a webpage
 
 
Event Attributes
 
Attribute
Description
onclick Script will run on mouse click
ondblclick Script will run on mouse double-click
onload Script will run once the webpage loads
onmousedown Script will run once mouse button is pressed
onmousemove Script will run once mouse pointer moves
onmouseout Script will run once mouse pointer moves out of the element
onmouseover Script will run once mouse pointer moves over an element
onmouseup Script will run once mouse button is released
onkeydown Script will run once a key is pressed
onkeypress Script will run once a key is pressed and released
onkeyup Script will run once a key is released
onunload Script will run once the webpage unloads
 

No comments: