For example:
<html>
<head>
<title> The second lesson</title>
</head>
<body background = "image.jpg "> This is the contain of body </body>
</html>
Below are the list of attributes and values that can be added in start tag / opening tag <body> tag .
Optional Attributes
The <body> tag supports the following optional attributes:
Attribute | Value | Description |
---|---|---|
alink | rgb(x,x,x) #xxxxxx colorname | Deprecated. Use styles instead. Specifies the color of an active link in a document |
background | URL | Deprecated. Use styles instead. Specifies a background image for a document |
bgcolor | rgb(x,x,x) #xxxxxx colorname | Deprecated. Use styles instead. Specifies the background color of a document |
link | rgb(x,x,x) #xxxxxx colorname | Deprecated. Use styles instead. Specifies the default color of unvisited links in a document |
text | rgb(x,x,x) #xxxxxx colorname | Deprecated. Use styles instead. Specifies the color of the text in a document |
vlink | rgb(x,x,x) #xxxxxx colorname | Deprecated. Use styles instead. Specifies the color of the visited links in a document |
Standard Attributes
The <body> tag supports the following standard attributes:
Attribute | Value | Description |
---|---|---|
class | classname | Specifies a classname for an element |
dir | rtl ltr | Specifies the text direction for the content in an element |
id | id | Specifies a unique id for an element |
lang | language_code | Specifies a language code for the content in an element |
style | style_definition | Specifies an inline style for an element |
title | text | Specifies extra information about an element |
xml:lang | language_code | Specifies a language code for the content in an element, in XHTML documents |
Event Attributes
The <body> tag supports the following event attributes:
Attribute | Value | Description |
---|---|---|
onclick | script | Script to be run on a mouse click |
ondblclick | script | Script to be run on a mouse double-click |
onload | script | Script to be run when a document load |
onmousedown | script | Script to be run when mouse button is pressed |
onmousemove | script | Script to be run when mouse pointer moves |
onmouseout | script | Script to be run when mouse pointer moves out of an element |
onmouseover | script | Script to be run when mouse pointer moves over an element |
onmouseup | script | Script to be run when mouse button is released |
onkeydown | script | Script to be run when a key is pressed |
onkeypress | script | Script to be run when a key is pressed and released |
onkeyup | script | Script to be run when a key is released |
onunload | script | Script to be run when a document unload |
*I am not recommend users to use standard and event attributes..Its make complicated.I just want to show the attributes that available for start tag / opening tag <body> tag .
Briefly , the codings should be formulated in this form <body attribute = "value "> .For example <body background = "image.jpg ">.
0 comments:
Post a Comment