110 likes | 353 Views
Introduction to HTML 4.0. Getting Started – Comments & Attributes. Teacher: Mr. Ho. Comments. Comments: English description that explains what a section of HTML code does. Why Comments?. Do you remember what you did in this class 3 or 4 weeks ago? Not Likely
E N D
Introduction to HTML 4.0 Getting Started – Comments & Attributes Teacher: Mr. Ho
Comments • Comments: English description that explains what a section of HTML code does
Why Comments? • Do you remember what you did in this class 3 or 4 weeks ago? Not Likely • That is why we need comments so that we will remember what the HTML code does.
How to Write Comments? • Opening Tag: <!-- • Closing Tag: --> • You write your comments between <!-- and --> • E.g.: <!-- Hello, I am Mr. Ho --> • Note: Comments will not be displayed on the screen.
Attributes • Most HTML tags have attributes, which add additional features to the HTML tags.
<body> … </body> • Has background, bgcolor, and text attributes. • background attribute: allows you to add a background image (i.e., wallpaper) to the HTML file • bgcolor attribute: allows you to add colour to the background of the HTML file • text attribute: allows you to set the colour of the text in the HTML file
Example: <body> … </body> <html> <head> <title>Demo of Attributes</title> </head> <body bgcolor=“red” background=“image.gif” text=“yellow”> Testing … </body> </html>
<h1> to <h6> Tags • Create the HTML headings • Have one attribute, which is align. • The align attribute can be set to the following values: • left • center • right • justify
Example: <h1> to <h6> Tags <html> <head> <title>Demos</title> </head> <body> <h1 align=“center”>Testing</h1> </body> </html>
<body> and <h1> to <h6> Tags • Note: <body> and <h1> tags do not have to include attributes. • Attributes are used so that you can add additional formatting features to your HTML file.
Questions & Answers • Do you have any questions so far? • If you do, please ask now.