BEFORE YOU BEGIN
1 About HTML
4 Use Attributes and Values
5 About Using Special Characters
6 About Proper HTML Coding
Just as the English language follows rules of grammar, HTML follows certain rules as well. These rules are not nearly as complicated as grammatical rules, but if you want a browser to understand the web page you're building, you'll have to follow them.
At the heart of these rulesand the core of HTMLare tags. HTML tags tell a browser how to display the elements of a page. The tags themselves aren't displayed, though; those remain invisible to people visiting a site.
In this task, you'll learn how to use HTML tagsspecifically, how to make text on a web page boldfaced. Although making text boldfaced is simple, the rules for creating tags are the same for making text boldfaced as they are for more complicated HTML commands.
2. Use HTML Tags
HTML pages are text files that contain commands that tell browsers how to display pages. So Notepad is a good tool for learning basic HTML, because you can easily create text files with HTML commands in it. To run Notepad, click the Start button, choose Run , type Notepad , and press Enter.
Save the File
In this exercise (and the rest of this chapter), you're going to view the results of what you do in Internet Explorer or another browser. Before you can do that, you need to save your file. Save it and give it an extension of .htm or .html . When you give a file that extension name, a browser such as Internet Explorer recognizes that it's a web page. If you don't give it that extension, you won't be able to view it in a browser, when it's on your own hard disk, or when it's on the Web. Be aware that when you save a file in Notepad, it often insists on a file name ending in .txt . Make sure that when you have your page in Notepad, you select All Files from the dropdown file type list, and choose a filename that ends in .htm or .html .
Start Your Tag
Tags are put between a < (called a left-angle bracket ) and a > (called a right-angle bracket.) There are no spaces between the brackets and the tag. Tags come before the text they affect. So to issue the HTML command that will tell a browser to display boldfaced text, type this before the text: <B> . This is called an opening tag . It doesn't matter if the content of your tag is uppercase or lowercase. So to make text bold, you can type either <B> or <b> . As a general rule, though, it's a good idea to use lowercase, because if you get to advanced web work using something called XHTML, you'll have to use lowercase letters .
KEY TERMOpening tag A tag that tells a browser how to display text or an element on a web page.
Type in Your Text
The text that the tag affects comes after the tag itself. So type in the text that you want to appear boldfor example, This is boldfaced text .
End Your Tag
Your HTML should now look like this: <B>This is boldfaced text . Now you need to end the tag, to tell the browser to stop displaying what follows as boldface. So after the text, type in </B> . This second tag is called the closing tag . Closing tags always use the forward slash symbol / . You can think of a set of tags as a container that performs an action on what's inside the container.
KEY TERMClosing tag A tag that tells a browser to stop displaying text in a certain way, or to stop displaying an element on a web page.
View Your Page
To see the results of what you've done, open Internet Explorer or another browser, and choose Open from the File menu. Click Browse and browse to the folder where you've saved your .html or .htm file. Double-click the file. The file will be displayedand the text in it will be bold.