Body and Heading Tags and their Attributes Body
Body and Heading Tags and their Attributes
Body Tag Attributes Attribute Name Definition Values background Indicates the background image of the Web page. Ex. <body background=“redflower. jpg”> Filename(path could be included)of the image file bgcolor Indicates the background color of the Web page. Ex. <body bgcolor=“red”> Assigned name or hexadecimal value of the color text Indicates the color of the text in the Web page. Ex. <body text=“black”> Assigned name or hexadecimal value of the color link Indicates the color of the hyperlinks in the Web page. Ex. <body link=“blue”> Assigned name or hexadecimal value of the color vlink Indicates the color of the visited hyperlinks in Assigned name or the Web page. hexadecimal Ex. <body vlink=“#FF 0000”> value of the color
Attribute Name Definition alink Indicates the color of the active hyperlinks (when clicked) in the Web page. Ex. <body alink=“#000000”> class, id, style Used in Cascading Style Sheets or CSS Body Values Assigned name or hexadecimal value of the color
Headings • These are container tags which format text using pre-defined values for size and color. • There are 6 heading tags and they are <h 1></h 1>, <h 2></h 2>, <h 3></h 3>, <h 4></h 4>, <h 5></h 5>, <h 6></h 6> • Used for titles and headers • The biggest Heading is <h 1> and the smallest is <h 6> • Note: Extra lines are placed after headings when displayed on a Web browser.
Heading Attributes Attribute Name Definition Values align Indicates the horizontal alignment of heading. Left, right, Ex. <h 1 align=“left”>This is left-aligned</h 1> center, justify title Indicates the text that appears when the mouse hovers over the heading. class, id, style Used in Cascading Style Sheets or CSS Any text
Heading Levels
Heading Alignments
Activity 1 List the attributes for the <body> tag. 1. Indicates the color of the active hyperlinks (when clicked) in the Web page. 2. Indicates the background color of the Web page. 3. Indicates the color of the hyperlinks in the Web page. 4. Indicates the color of the text in the Web page. 5. Indicates the background image of the Web page. 6. Indicates the color of the visited hyperlinks in the Web page.
Activity 2 Make the necessary corrections to the following HTML codes. Write correct on the answer sheet if the code is free from error. 1. <body></body> 2. <body bground=“redflower. jpg”> <body background=“redflower. jpg”> 3. <body background color=“red”> <body bgcolor=“red”> 4. <body text=black> <body text=“black”> 5. <body link “blue”> <body link=“blue”> 6. body vlink=“#ff 0000” <body vlink=“#ff 0000”> 7. body alink=“#000000” <body alink=“#000000”> 8. <h 1><h 1/> <h 1></h 1> 9. <h 1 align=“left”> 10. <h 2></h 2>
Activity 3 Put T if the statement is true and put F if the statement is false. 1. 2. 3. 4. Background indicates the background color of the Web page. Attributes provide additional information about the tag. The text indicates the color of the text in the Web page. Headings are container tags which format text using pre-defined value for size and color. 5. The background color indicates the background image of the Web page. 6. Link indicates the color of the hyperlinks in the Web page. 7. There are 6 heading tags used in making HTML. 8. The align attribute indicates the vertical alignment of heading. 9. Extra lines are placed after headings when displayed on a Web browser. 10. The vlink attribute indicates the color of the visited hyperlinks in the Web page.
- Slides: 10