Attributes of body tag→
There are mainly two attributes , that we use to change the background of body.
1. Bgcolor- This attributes is used to change the background color of our web page.
Syntax→ <body bgcolor="color name">
................
................
................
</body>
Program to demonstrate the above attribute.
<html>
<title>second file</title>
<body bgcolor="red">
welcome to html
</body>
</html>
Save the file with name second.html, and output will be as below.
2. Background- This attribute of body tag is used to set image at the background of web page.
Syntax→ <body background="file name">
................
................
................
</body>
Program to demonstrate the above attribute.
<html>
<title>third file</title>
<body background="pic.jpg">
welcome to html
</body>
</html>
Save the file with name third.html, and output will be as below.
Note -- Both the Html and image file must be at the same location for above programe
There are mainly two attributes , that we use to change the background of body.
1. Bgcolor- This attributes is used to change the background color of our web page.
Syntax→ <body bgcolor="color name">
................
................
................
</body>
Program to demonstrate the above attribute.
<html>
<title>second file</title>
<body bgcolor="red">
welcome to html
</body>
</html>
Save the file with name second.html, and output will be as below.
2. Background- This attribute of body tag is used to set image at the background of web page.
Syntax→ <body background="file name">
................
................
................
</body>
Program to demonstrate the above attribute.
<html>
<title>third file</title>
<body background="pic.jpg">
welcome to html
</body>
</html>
Save the file with name third.html, and output will be as below.
Note -- Both the Html and image file must be at the same location for above programe
No comments:
Post a Comment