HTML Attributes

Every tag they have a nature attributes will modify or apply new style to html tag.
Syntax: <tag attribute=value>
HTML supports pre defined attributes and user defined attributes 

Body Attributes

ID: Specify id for body tag
Name: Specify body name
Class: Specify body class
Style: Apply inline CSS to specific element

Note: This four attributes supports all the html tags

Text: Apply color to the text data in body tag use color name or color code
Bgcolor: Apply background color to body tag
Background: Set image in body background
Leftmargin: Apply leftmargin to body tag
Topmargin: Apply topmargin to body tag
Link: Apply color to non visited link
Vlink: Apply color to visited link
Alink: apply color to active link
Example of body tag attributes:
<html>
<head>
<title>body attributs</title>
</head>
<body id=’x’ name=’abc’ class=’x’ style=’x’ text=’red’ bgcolor=’blue’ background=”image path.extension’ leftmargin=’0px’ topmargin=’0px’ link=’blue’ vlink=’green’ alink=’red’>Welcome</body>
</body>


</html>

No comments:

Post a Comment