Body Tag in HTML5.

0 comments

The code generates what is seen in a browser is contained within a Body<body>tag or you can say that  for all the renderable content of the document it acts as a container .
There is only a single <body> element in a document.

The attributes of the HTML body elements are ( “background”, “text”, “vlink”, “link”, and “alink”,”bgcolor”,)

Example of a basic document

<html>
<head>
<title>Example for the HTML body tag</title>
</head>
<body>
Document's content.
</body>
</html>

Some attributes of body element:

    • link (color):this attribute sets the color which is used by the text in all the unvisited links

<body link="blue">

    • vlink (color):this attribute sets the color which is used by the text in all the visited links .

<body vlink="blue">

    • alink (color):this attribute sets the color when they are selected by the visitor .

<body alink="blue">

    • bgcolor (color):this attribute sets the color used as background of the document.

<body bgcolor="green">

    • background (uri) :this attribute sets the value points to an image that will be used as background of the document.

<body background="../images/one.gif">

Some Events of body element:

  • onload :This event is triggered when a user finishes loading a window or we can say that when body is finishes loading .
  • onunload : This event is fired when a user removes a document from a window or frame.
  • onclick : This event is executed when the mouse button is clicked over the element
  • ondblclick :This event is executed when the mouse button is double clicked over the element.
  • onmousedown :This event is triggered when the mouse button is pressed over the element.
  • onmouseup :This event is fired when the mouse button is released over the element.
  • onmouseover :This event is triggered when the mouse button is moved while it is over the element.
  • onmousemove :This event is triggered when the mouse button is moved onto the element.
  • onmouseout : This event is triggered when the mouse is moved away from element.
  • onkeypress : This event is triggered when a key is pressed and released while the element is focused.
  • onkeydown : This event is executed when the mouse button is pressed down while the element is focused.
  • onkeyup :This event is triggered when a key is released while the element is focused.

Categories: Designs, Html, Main

Leave A Comment

Loading...