HTML Tutorial |
Lesson 2 | ||||
Home Introduction to HTML <html> to </html> <body> to </body> Formatting Links Backgrounds Tables Frames Other tags A little Style Resources |
• Tags covered in this lesson: • Explanation: • Working examples: Tags covered in this lesson: The body tag Everything that is visible on the screen goes between the <body> and </body> tags. The only time we can omit this is when creating a frame page. But we will cover that later. For now just remember that this is the holder tag that contains all information you can see on the screen.One more information you could add to the body tag is: 'bgcolor="#ffffff"' like this: <body bgcolor="#ffffff"> This bgcolor="#ffffff" denotes that the background colour of the page is to be white. There are lots of other colours that you can use as per your taste. In the resources page there is a list of websites with information on web safe colour charts. Check them for a complete list of web safe colours. The paragraph tag In the previous lesson we did not add any text to our page. Now is the time to do so.1. Below the <body> tag type this: <p>This, as the title suggests is my First Page.</p> <p>I am learning HTML and am going to master it</p> 2. Save the file once more and view it in your browser. See those two <p> and </p> tags, they are the Paragraph Tags. These two separate sentences are two paragraphs, therefore we will call them Paragraphs. What do you see? I have two simple, left aligned lines. Q. Did I say "Left Aligned"? A. Yes, I did. Q. Did I hear you say "I want it centered"? A. Great, let us centre it. Alignment The basic idea here is to align the text in the <p> element. Therefore, type this:<p align="center">This, as the title suggests is my First Page.</p> <p align="center">I am learning HTML and am going to master it</p> Now, you have it in the centre of the page! You can also align it right if you choose. It's your wish, just type "right" in the place of "center". |
Home | Introduction to HTML | <html> to </html> | <body> to </body> | Formatting | Links | Backgrounds
Tables | Frames | Other tags | A little Style | Resources |