Html Body Tag Attributes with examples |Free Pdf |HTML TUTORIALS #4
When we discussed about the Document structure of the HTML , we also discussed about the body element then , <body> tag represents the Document start we generally put all the visible elements of the Html Page in Body section.
Here is some Html Code
<title>Free Html Tutorials</title>
<h1>Html Body Tag Attributes with examples </h1>
<p>Please do Subscribe ..... !!</p>
So as you can see we have put all the visible elements , like H1 and paragraph elements inside the body tag . There are some attributes for the body tag , attributes are nothing but some additional properties that we can put inside a tag .
Html Body Tag Attributes with examples
Red Colored Attributes are not supported by HTML 5 and are considered obsolete .
Text : Gives Text inside the body tag the specific color .
Bgcolor : Add Specific Color to the background.
<span style="color: #ff0000;"><body bgcolor="#00ccee"></span>
Background : We can any image as the background by giving its URL in the attribute .
Alink : Colors all the a elements present in the body tag .
Vlink : The defualt color for all the elements in the body section.
Link : The default color of the text in all links contained by the element.
Body Element Specific Attributes HTML 5
The following table shows the attributes that are specific to this body tag/element.
HTML5 introduced the following event handlers that can be used with the
<body> element .
|onafterprint||The afterprint event handler|
|onbeforeprint||The beforeprint event handler|
|onbeforeunload||The beforeunload event handler|
|onhashchange||The hashchange event handler|
|onmessage||The message event handler|
|onoffline||The offline event handler|
|ononline||The online event handler|
|onpagehide||The pagehide event handler|
|onpageshow||The pageshow event handler|
|onpopstate||The popstate event handler|
|onstorage||The storage event handler|
|onunload||The unload event handler|
Read this Article offline also , Download PDF Version by clicking the pdf icon
If you liked our content please Subscribe to our Website for more helpful content.