Welcome to Egypt Forums Mark forums read | Egypt Main Page
Egypt Forums
Arabic Movies



Programming Languages A Place for windows applications programs and programmers .

Programming Languages Thread, HTML in 1 day in Programming , WebDesign & Development; Hour 1 Welcome to HTML Before you begin creating your own Web pages with HTML, you need some backgroundknowledge about ...

Short Link: http://forum.egypt.com/enforum/showthread.php?t=2150


Reply
 
 
The God Father
Developer's Avatar

Reply With Quote
 
Join Date: Jul 2008
Location: NDC
Posts: 5,425
16-07-2008, 11:18 PM
 
Hour 1
Welcome to HTML
Before you begin creating your own Web pages with HTML, you need some backgroundknowledge about what Web pages are, how they work, and what you can expect to achievewith them. This chapter provides a quick summary of those basics and some practicaltips to make the most of your time as a Web page author and publisher. To Do: Thisbook assumes that you have spent some time exploring Web pages on the Internet. Ifyou haven't, please take at least a couple of hours to do so now. Trying to produceyour own Web pages without having "surfed" the World Wide Web would belike trying to become a famous author without ever having seen a piece of paper!

Here's a review of what you need to do before you're ready to use the rest ofthis book:

1. Get a computer. I used a Windows 95 computer to create the figures in this book, but you can use any Windows, Macintosh, or UNIX machine to create your Web pages. (You can look at Web pages with a TV nowadays, but you can't make them with one... yet!)

2. Get a connection to the Internet. You should be able to get one through either a modem or the local network of your school or business. An old UNIX "shell" account won't do the trick; it has to be a modern PPP (Point-to-Point Protocol) connection, which most Internet service providers (ISP) now offer for about $20 per month. Your access speed should be at least 14.4 Kbps, though faster is better. The ISP, school, or business that provides your connection can help you with the details of setting it up properly.

3. Get a copy of Netscape Navigator and/or Microsoft Internet Explorer (version 3.0 or higher). Together, these two Web browser programs are used by over 90 percent of the people who look at Web pages, so it's a good idea to get them both. You can buy them in software stores, or get them free through the Internet at http://home.netscape.com and http://www.microsoft.com.

4. Explore! Use Netscape Navigator or Microsoft Internet Explorer to look for pages that are similar in content or appearance to those you'd like to create. Make notes about what frustrates you about some pages, what attracts you and keeps you reading, and what makes you come back to some pages over and over again.


--------------------------------------------------------------------------------
Just A Minute: If you plan to put your HTML pages on the Internet (as opposed to publishing them on CD-ROM or a local intranet), you'll need to transfer them to a computer that is connected to the Internet 24 hours a day. The same company or school that provides you with Internet access may also let you put Web pages on its computer; if not, you may need to pay another company to "host" your pages. You can start learning HTML with this book right away and wait to find an Internet host for your pages when they're done. However, if you want to have a place on the Internet ready for your very first page as soon it is finished, you may want to read Chapter 4, "Publishing Your HTML Pages," before you continue.
--------------------------------------------------------------------------------

What Is a Web Page?
Once upon a time, back when there weren't any footprints on the moon, some far-sightedfolks decided to see whether they could connect several major computer networks together.I'll spare you the names and stories (there are plenty of both), but the eventualresult was the "mother of all networks," which we call the Internet.

Until 1990, accessing information through the Internet was a rather technicalaffair. It was so hard, in fact, that even Ph.D.-holding physicists were often frustratedwhen trying to swap data. One such physicist, the now famous Tim Berners-Lee, cookedup a way to easily cross-reference text on the Internet through "hypertext"links. This wasn't a new idea, but his simple Hypertext Markup Language (HTML) managedto thrive while more ambitious hypertext projects floundered.


--------------------------------------------------------------------------------
New Term: Hypertext means text stored in electronic form with cross-reference links between pages.
--------------------------------------------------------------------------------

By 1993, almost 100 computers throughout the world were equipped to serve up HTMLpages. Those interlinked pages were dubbed the World Wide Web (WWW), and severalWeb browser programs had been written to allow people to view Web pages. Becauseof the popularity of "the Web," a few programmers soon wrote Web browsersthat could view graphics images along with the text on a Web page. One of these programmerswas Marc Andreessen; he went on to become rich and famous selling the world's mostpopular Web browser, Netscape Navigator.

Today, HTML pages are the standard interface to the Internet. They may includeanimated graphics, sound and video, complete interactive programs, and good old-fashionedtext. Millions of Web pages are retrieved each day from thousands of Web server computersaround the world.

The Web is on the verge of becoming a mass-market medium, as high-speed Internetconnections through TV cables, modernized phone lines, and direct satellite feedsbecome commonplace. You can already browse the Web using a $300 box attached to yourtelevision instead of using your computer, and the cost of such devices is likelyto fall sharply over the next few years.

Yet the Internet is no longer the only place you'll find HTML. Most private corporatenetworks now use HTML to provide business information to employees and clients. HTMLis now the interface of choice for publishing presentations on CD-ROM and the newhigh-capacity digital versatile disk (DVD) format. Microsoft is even integratingHTML directly into the Windows operating system, allowing every storage folder inyour computer to be associated with an HTML page and hypertext links to other foldersand pages.

In short, HTML is everywhere. Fortunately, you're in the right place to find outhow HTML Web pages work and how to create them.

How Web Pages Work
When you are viewing Web pages, they look a lot like paper pages. At first glance,the process of displaying a Web page is simple: You tell your computer which pageyou want to see, and the page appears on your screen. If the page is stored on adisk inside your computer, it appears almost instantly. If it is located on someother computer, you might have to wait for it to be retrieved.

Of course, Web pages can do some very convenient things that paper pages can't.For example, you can't point to the words "continued on page 57" in a papermagazine and expect page 57 to automatically appear before your eyes. Nor can youtap your finger on the bottom of a paper order form and expect it to reach the company'sorder fulfillment department five seconds later. You're not likely to see animatedpictures or hear voices talk to you from most paper pages either (newfangled greetingcards aside). All these things are commonplace on Web pages.

But there are some deeper differences between Web pages and paper pages that you'llneed to be aware of as a Web page author. For one thing, what appears as a single"page" on your screen may actually be an assembly of elements located inmany different computer files. In fact, it's possible (though uncommon) to createa page that combines text from a computer in Australia with pictures from a computerin Russia and sounds from a computer in Canada.

Figure 1.1 shows a typical page as seen by Netscape Navigator, the world's mostpopular software for viewing Web pages. A Web browser such as Netscape Navigatordoes much more than just retrieve a file and put it on the screen; it actually assemblesthe component parts of a page and arranges those parts according to commands hiddenin the text by the author. Those commands are written in HTML.


--------------------------------------------------------------------------------
New Term: A Web browser is a computer program that interprets HTML commands to collect, arrange, and display the parts of a Web page.
--------------------------------------------------------------------------------

Figure 1.2 shows the text, including the HTML commands I typed to create the pagein Figure 1.1. This text file can be read and edited with any word processor or texteditor. It looks a bit strange with all those odd symbols and code words, but thetext file itself doesn't include any embedded images, boldface text, or other specialformatting.

Figure1.1. A Web browser assembles separatetext and image files to display them as an integrated page.

All the images and formatting you see in Figure 1.1 are added by Netscape Navigator.It reads the coded HTML commands in the text, which tell it to look for separateimage files and display them along with the text itself. Other commands tell it whichtext to display in boldface and how to break up the lines of text on the page.

Figure1.2. This is the text I typed to createthe page in Figure 1.1. The words between < and > are HTMLtags.



--------------------------------------------------------------------------------
Time Saver: To see the HTML commands for any page on the Web, select View | Document Source in Netscape Navigator or View | Source in Microsoft Internet Explorer. This is a great way to get an intuitive idea how HTML works and learn by other's examples.
--------------------------------------------------------------------------------

You'll learn how to understand and write HTML commands soon. The important pointto note right now is that creating a Web page is just a matter of typing some text.You can type and save that text with any word processor or text editor you have onhand. You then open the text file with Netscape Navigator or Microsoft Internet Explorerto see it as a Web page.

When you want graphics, sound, animations, video, or interactive programming toappear on a Web page, you don't insert them into the text file directly, as you wouldif you were creating a document in most paper-oriented page layout programs. Instead,you type HTML text commands telling the Web browser where to find the media files.The media files themselves remain separate, even though the Web browser will makethem look as if they're part of the same document when it displays the page.

For example, the HTML document in Figure 1.2 refers to three separate graphicsimages. Figure 1.3 shows these three image files being edited in the popular graphicsprogram Paint Shop Pro.

Figure1.3. Though text and graphics appear integratedin Figure 1.1, the graphics files are actually stored, and can be edited, separately.

You could use any graphics program you like to modify or replace these imagesat any time. Changing the graphics might make a big difference in how the page looks,even if you don't make any changes to the HTML text file. You can also use the sameimage on any number of pages while storing only one copy of the graphics file.

You'll learn much more about incorporating graphics files into Web pages in PartIII, "Web Page Graphics."

The Many Faces ofHTML
A single Web page can take on many different appearances, depending on who viewsit and what they view it with. Figure 1.4 is the same Web page pictured earlier inFigure 1.1, as seen with the text-based Lynx Web browser. Lynx users can only seethe images if they click on the [IMAGE] links at the top of the page.

Figure1.4. The page from Figure 1.1 looks verydifferent in the DOS Lynx browser.

People who are using different versions of the same Web browser may also see significantdifferences in a page. Version 1.2 of Netscape Navigator was used to display thepage in Figure 1.5. Notice that the title graphic placement is different than displayedby Netscape Navigator version 3.0 in Figure 1.1.

Even users of the same version of the same Web browser can alter how a page appearsby choosing different display options. Both Netscape Navigator and Microsoft InternetExplorer allow users to override the background and fonts specified by the Web pageauthor with those of their own choice. Screen resolution, window size, and optionaltoolbars can also change how much of a page someone sees when it first appears.

Figure1.5. Netscape Navigator version 1.2 maydisplay some pages differently than other versions of the same browser.

You can't even assume that people will be viewing your Web pages on a computerscreen. The page in Figures 1.1, 1.4, and 1.5 might also be read on a low-resolutiontelevision screen (see Figure 1.6) or a high-resolution paper printout (see Figure1.7).

Figure1.6. Televisionscreens may blur images, and TV Web browsers usually use a larger font to make textreadable from a distance.

Figure1.7. Web browsers usually change the backgroundto white when sending pages to a printer.

As you learn to make your own Web pages, remember how many different forms theymay take when people view them. Some Web page authors fall into the trap of tryingto make pages appear "perfect" on their computer and are sorely disappointedthe first time they discover that it looks different on someone else's screen.

In Part IV, "Web Page Design," you'll find many tips and tricks forensuring that your pages look great in the widest variety of situations.

Creating HTML witha Text Editor
There are two basic approaches to making an HTML page: you can type out the textand HTML commands yourself with a text editor, or you can use graphical softwarethat generates the HTML commands for you.

Chapter 23, "Web Site Authoring Tools," introduces some of the HTMLediting tools that are available and discusses when to use each type of tool. Fornow, however, I strongly recommend that you do not use a graphical, "what-you-see-is-what-you-get"Web page editor, such as Microsoft FrontPage or Netscape Navigator Gold (which isa different program than Netscape Navigator).

You will be able to follow along with this book and learn HTML much more easilyif you work with an editor that shows the actual HTML text. Any word processor ortext editor you already have--even the Windows Notepad or Macintosh SimpleText editor--willdo nicely.



--------------------------------------------------------------------------------
Coffee Break: In this book, you'll encounter many sample Web pages. The accompanying 24-Hour HTML Café Web site (http://www.mcp.com/sams/books/ 235-8/) has even more sample pages for you to explore. In addition to all these examples, you can follow the development of a complete, sophisticated Web site from the ground up as you go through the book. You might like to preview this "construction site" now at
http://www.mcp.com/sams/books/235-8/cafe1.htm

Doing so will give you an overview of how this book presents HTML and help you plan the development of your own pages. It will also help you see which chapters cover the aspects of HTML you're most likely to use in the pages you plan to build.


--------------------------------------------------------------------------------

Summary
This chapter introduced the basics of what Web pages are and how they work. Youlearned that coded HTML commands are included in the text of a Web page, but imagesand other media are stored in separate files. You also saw that a single Web pagecan look very different, depending on what software and hardware are used to displayit. Finally, you learned why typing HTML text yourself is often better than usinga graphical editor to create HTML commands for you.

Q&A
Q I'm still not quite sure what the difference between a "Web page" and an "HTML page" is.

A If you want to get technical, I suppose a "Web page" would have to be from the Internet instead of a disk on your own computer. But in practice, the terms "Web page" and "HTML page" are used interchangeably.

Q I've looked at the HTML "source" of some Web pages on the Internet, and it looks frighteningly difficult to learn. Do I have to think like a computer programmer to learn this stuff?

A Though complex HTML pages can indeed look daunting, learning HTML is several orders of magnitude easier than other computer languages like BASIC, C, or Java. You don't need any experience or skill as a computer programmer to be a very successful HTML author.

Q Do you need to be connected to the Internet constantly while you create HTML pages?

A No. In fact, you don't need any Internet connection at all if you only want to produce Web pages for publication on a CD-ROM, Zip or floppy disk, or local network.
Quiz Questions
1. Define the terms Internet, Web page, and World Wide Web.

2. How many files would you need to store on your computer to make a Web page with some text and two images on it?

3. Can you create Web pages with Microsoft Word or WordPerfect?

- Hour 2 -
Creating a Web Page
This chapter will guide you through the creation of your first Web page. The best way to follow along with this chapter is to actually create a Web page as you read, using the sample page developed here in the book as a model. If you're a little nervous about jumping right in, you might want to read this chapter once to get the general idea, and then go through it again at your computer while you work on your own page.

As mentioned in Chapter 1, "Welcome to HTML," you can use any text editor or word processor to create HTML Web pages. Though you'll eventually want to use an editor specially designed for HTML, for this chapter I recommend you use the editor or word processor you're most familiar with. That way you won't have to learn a new software program at the same time you're starting to learn HTML. Even a simple text editor like Windows Notepad will work just fine. To Do: Before you begin working with this chapter, you should start with some text that you want to put on a Web page.

1. Find (or write) a few paragraphs of text about yourself, your company, or the intended subject of your Web pages.

2. Be sure to save it as plain, standard ASCII text. Notepad and most simple text editors always save files as plain text, but you may need to choose it as an option if you're using a word processor. For most word processors, you'll see a check box labeled plain text or ASCII text when you select File | Save As....

3. As you go through this chapter, you will add HTML commands (called tags) to the text file, making it into a Web page. You can do this with the same text editor or word processor you used to type the text in the first place.

4. Always give files containing HTML tags a name ending in .htm or .html when you save them.
Tags That Every HTML Page Must Have
Figure 2.1 shows the text you would type and save to create the simplest possible HTML page. If you opened this file with a Web browser such as Netscape Navigator, you would see the page in Figure 2.2.

In Figure 2.1, as in every HTML page, the words starting with < and ending with > are actually coded commands. These coded commands are called HTML tags because they "tag" pieces of text and tell the Web browser what kind of text it is. This allows the Web browser to display the text appropriately.


--------------------------------------------------------------------------------
New Term: An HTML tag is a coded command used to indicate how part of a Web page should be displayed.
--------------------------------------------------------------------------------



--------------------------------------------------------------------------------
Just A Minute: In Figure 2.1, and most other figures in this book, HTML tags are printed darker than the rest of the text so you can easily spot them. When you type your own HTML files, all the text will be the same color (unless you are using a special HTML editing program that uses color to highlight tags, as HTMLED does).
--------------------------------------------------------------------------------

Figure 2.1. Every Web page you create must include the <HTML>, <HEAD>, <TITLE>, and <BODY> tags.

Figure 2.2. When you view the Web page in Figure 2.1 with a Web browser, only the actual title and body text show up.

Most HTML tags have two parts: an opening tag, to indicate where a piece of text begins, and a closing tag, to show where the piece of text ends. Closing tags start with a / (forward slash) just after the < symbol.

For example, the <BODY> tag in Figure 2.1 tells the Web browser where the actual body text of the page begins, and </BODY> indicates where it ends. Everything between the <BODY> and </BODY> tags will appear in the main display area of the Web browser window, where you see "Hello world!" in Figure 2.2.

Netscape Navigator displays any text between <TITLE> and </TITLE> at the very top of the Netscape window, as in Figure 2.2. (Some older Web browsers display the title in its own special little box instead.) The title text will also be used to identify the page on the Netscape Navigator Bookmarks menu, or the Microsoft Internet Explorer Favorites menu, whenever someone selects Add Bookmark or Add to Favorites.

You will use the <BODY> and <TITLE> tags in every HTML page you create because every Web page needs a title and some body text. You will also use the other two tags shown in Figure 2.1, <HTML> and <HEAD>. Putting <HTML> at the very beginning of a document simply indicates that this is a Web page. The </HTML> at the end indicates that the Web page is over.

Don't ask me to explain why you have to put <HEAD> in front of the <TITLE> tag and </HEAD> after the </TITLE> tag. You just do. (Chapter 22, "HTML Tags for Site Management," reveals some other advanced header information that can go between <HEAD> and </HEAD>, but none of it is necessary for most Web pages.)



--------------------------------------------------------------------------------
Time Saver: You may find it convenient to create and save a "bare-bones" page with just the opening and closing <HTML>, <HEAD>, <TITLE>, and <BODY> tags, similar to the document in Figure 2.1. You can then open that document as a starting point whenever you want to make a new Web page and save yourself from typing out all those "obligatory" tags every time. (This won't be necessary if you use a dedicated HTML editing program, which will usually put these tags in automatically when you begin a new page.)
--------------------------------------------------------------------------------

Paragraphs and Line Breaks
When a Web browser displays HTML pages, it pays no attention to line endings or the number of spaces between words. For example, the two verses in Figure 2.3 are both displayed exactly the same by Netscape Navigator in Figure 2.4, with a single space between all words. When the text reaches the edge of the Netscape window, it automatically wraps down to the next line, no matter where the line breaks were in the original HTML file.

Figure 2.3. In HTML, it makes no difference how many spaces or lines you use when typing your text.

To control where line and paragraph breaks actually appear, you must use HTML tags. The <BR> tag forces a line break, and the <P> tag creates a paragraph break. The only practical difference between these two tags is that <P> inserts an extra blank line between paragraphs, and <BR> does not.

Figure 2.4. The two verses in Figure 2.3 appear identical in a Web browser.

You might have also noticed the <HR> tag in Figure 2.3, which causes a horizontal "rule" line to appear in Figure 2.4. Inserting a horizontal rule with the <HR> tag also causes a line break, even if you don't include a <BR> tag along with it. For a little extra blank space above or below a horizontal rule, you can put a <P> tag before or after the <HR> tag.

Neither the <BR> line break tag nor the <HR> horizontal rule tag needs a closing </BR> or </HR> tag.



--------------------------------------------------------------------------------
Time Saver: The <P> paragraph tag doesn't require a closing </P> tag at the end of the paragraph because a paragraph obviously ends whenever the next one begins. You may occasionally see Web pages which do use the </P> tag to close paragraphs, but this is never necessary.
--------------------------------------------------------------------------------

Figure 2.5 shows the <BR> and <P> tags being used to separate the lines and verses of a nursery rhyme and to separate two paragraphs of text commenting on the rhyme. Figure 2.6 is the resulting Web page.

Figure 2.5. Use the <BR> tag for line breaks, and the <P> tag to skip a line between paragraphs.

Figure 2.6. The <BR> and <P> tags in Figure 2.5 become line and paragraph breaks on this Web page.

To Do: Take a passage of text you have on hand and try your hand at formatting it as proper HTML.

1. Add <HTML><HEAD><TITLE>My Title</TITLE></HEAD><BODY> to the beginning of the text (using your own title for your page Instead of My Title).

2. Add </BODY></HTML> to the very end of the text.

3. Add <P> tags between paragraphs, and <BR> tags anywhere you want single-spaced line breaks.

4. Use <HR> to draw horizontal rules separating major sections of text, or wherever you'd like to see a line across the page.

5. Save the file as mypage.htm (using your own filename instead of mypage). If you are using a word processor, be sure to always save HTML files in plain text or ASCII format.

6. Open the file with Netscape Navigator or Microsoft Internet Explorer to see your Web page!

7. If something doesn't look right, go back to the text editor or word processor to make corrections and save the file again. You will then need to click on Reload (in Netscape Navigator) or Refresh (in Microsoft Internet Explorer) to see the changes you made to the Web page.
Headings
When you browse through Web pages on the Internet, you can't help but notice that most of them have a heading at the top which appears larger and bolder than the rest of the text. Figure 2.8 is a simple Web page, containing examples of the three largest heading sizes that you can make with HTML.

As you can see in Figure 2.7, the HTML to create headings couldn't be simpler. For a big level 1 heading, put an <H1> tag at the beginning and an </H1> tag at the end. For a slightly smaller level 2 heading, use <H2> and </H2> instead, and for a little level 3 heading, use <H3> and </H3>.

Theoretically, you can also use <H4>, <H5>, and <H6> to make progressively less important headings, but nobody uses these very much--after all, what's the point of a heading if it's not big and bold? Besides, most Web browsers don't show a noticeable difference between these and the already-small <H3> headings anyway.



--------------------------------------------------------------------------------
Just A Minute: On many Web pages these days, graphical images of ornately rendered letters and logos are often used in place of the ordinary text headings discussed in this chapter. You'll discover how to create graphics and put them on your pages in Part III, "Web Page Graphics." However, old-fashioned text headings are still widely used, and have two major advantages over graphics headings: n Text headings transfer and display almost instantly, no matter how fast or slow the reader's connection to the Internet is. n Text headings can be seen in all Web browsers and HTML- compatible software, even old DOS and UNIX programs that don't show graphics.
--------------------------------------------------------------------------------

Figure 2.7. Any text between the <H1> and </H1> tags will appear as a large heading. <H2> and <H3> make smaller headings.

Figure 2.8. The <H1>, <H2>, and <H3> tags in Figure 2.7 make the three progressively smaller headings shown here.

It's important to remember the difference between a title and a heading. These two words are often interchangeable in day-to-day English, but when you're talking HTML, <TITLE> gives the entire page an identifying name which isn't displayed on the page itself. The heading tags, on the other hand, cause some text on the page to be displayed with visual emphasis. There can only be one <TITLE> per page, but you can have as many <H1>, <H2>, and <H3> headings as you want, in any order that suits your fancy.

You'll learn to take complete control over the appearance of text on your Web pages in Part II, "Web Page Text." Yet headings provide the easiest and most popular way to draw extra attention to some important text.

Peeking at Other Peoples Pages
If you've even taken a quick peek at the World Wide Web, you know that the simple text pages described in this chapter are only the tip of the HTML iceberg. Now that you know the basics, you may surprise yourself with how much of the rest you can pick up just by looking at other people's pages on the Internet. As mentioned in Chapter 1, you can see the HTML for any page by selecting View | Document Source in Netscape Navigator, or View | Source in Microsoft Internet Explorer.

Don't worry if you aren't yet able to decipher what some HTML tags do, or exactly how to use them yourself. You'll find out all that in the next few chapters. However, sneaking a preview now will show you the tags you do know in action, and give you a taste of what you'll soon be able to do with your Web pages.


--------------------------------------------------------------------------------
Coffee Break: The HTML goodies at my 24-Hour HTML Café are specially designed to be intuitive and easy to understand.
--------------------------------------------------------------------------------

The HTML used in the main entrance page at http://www.mcp.com/sams/books/235-8 may look a bit intimidating now, but you'll see how I developed this sophisticated site step-by-step as you work through each chapter of this book.

You can uncover the humble beginnings of the 24-Hour HTML Café at http://www.mcp.com/sams/books/235-8/cafe2.htm which uses only the tags introduced in this chapter.

Summary
In this chapter, you've been introduced to the most basic and important HTML tags. By adding these coded commands to any plain text document, you can quickly transform it into a bona fide Web page.

The first step in creating a Web page is to put a few obligatory HTML tags at the beginning and end, including a title for the page. You then mark where paragraphs and lines end, and add horizontal rules and headings if you want. Table 2.1 summarizes all the tags introduced in this chapter.

Table 2.1. HTML tags covered in Chapter 2. Tag Function
<HTML>...</HTML> Encloses the entire HTML document.
<HEAD>...</HEAD> Encloses the head of the HTML document.
<TITLE>...</TITLE> Indicates the title of the document. Used within <HEAD>.
<BODY>...</BODY> Encloses the body of the HTML document.
<P>...</P> A paragraph. The closing tag (</P>) is optional.
<BR> A line break.
<HR> A horizontal rule line.
<H1>...</H1> A first-level heading.
<H2>...</H2> A second-level heading.
<H3>...</H3> A third-level heading.
<H4>...</H4> A fourth-level heading (seldom used).
<H5>...</H5> A fifth-level heading (seldom used).
<H6>...</H6> A sixth-level heading (seldom used).


Q&A
Q Okay, so I've got this HTML Web page on my computer now. How do I get it on the Internet so everyone else can see it?

A Chapter 4, "Publishing Your HTML Pages," explains how to put your pages on the Internet as well as how to get them ready for publishing on a local network or CD-ROM.

Q I want "Fred's Fresh Fish" to appear both at the top of my page and on people's bookmark (or favorites) lists when they bookmark my page. How can I get it to appear both places?

A Make a heading at the top of your page with the same text as the title, like this:
<HTML><HEAD><TITLE>Fred's Fresh Fish</TITLE></HEAD>

<BODY><H1>Fred's Fresh Fish</H1>

...the rest of the page goes here...

</BODY></HTML>


Q I've seen Web pages on the Internet that don't have <HTML> tags at the beginning. I've also seen pages with some other weird tags in front of the <HTML> tag. You said pages always have to start with <HTML>. What's the deal?

A Many Web browsers will forgive you if you forget to put in the <HTML> tag, and display the page correctly anyway. Yet it's a very good idea to include it because some software does need it to identify the page as valid HTML.

In fact, the official standard goes one step further and recommends that you put a tag at the beginning that looks like this: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN//3.2"> to indicate that your document conforms to the HTML 3.2 standard. No software that I've ever heard of pays any attention to this tag, however. It is not likely to be required in the near future, since so few of the millions of Web pages in the world include it.
Quiz Questions
1. What four tags are required in every HTML page?

2. Insert the appropriate line break and paragraph break tags to format the following poems with a blank line between them:
Good night, God bless you, Go to bed and undress you.
Good night, sweet repose, Half the bed and all the clothes.

3. Write the HTML for the following to appear one after the other:
A small heading with the words, "We are Proud to Present"

A horizontal rule across the page

A large heading with the one word "Orbit"

A medium-sized heading with the words, "The Geometric Juggler"

Another horizontal rule
4. Write a complete HTML Web page with the title "Foo Bar Home Page" and a heading at the top which reads "Happy Hour at the Foo Bar," followed by the words, "Come on down!" in regular type.


Hour 3
Linking to Other Web Pages
In the previous two chapters, you learned how to create an HTML page with some text on it. However, to make it a "real" Web page you need to connect it to the rest of the World Wide Web--or at least to your own personal or corporate "web" of pages.

This chapter will show you how to create hypertext links--those underlined words that take you from one Web page to another when you click on them with your mouse. You'll also learn to create links that go to another part of the same page.

Though the same HTML tag you'll learn in this chapter is also used to make graphics images into clickable links, graphical links aren't explicitly discussed here. You'll learn to create those in Chapter 9, "Putting Images on a Web Page." The more advanced technique of setting up several links from different regions of the same image is explained in Chapter 15, "Image Maps."

Linking to Another Web Page
The tag to create a link is called <A>, which stands for "anchor." (Don't even try to imagine the thought process of the person who came up with this strange name for a link between pages. As Thomas Carlyle once said, "The coldest word was once a glowing new metaphor.") You put the address of the page to link to in quotes after HREF=, like this:

<A HREF="http://netletter.com/dicko/welcome.htm">Click here!</A>


The link above would display the words Click here! in blue with an underline. When someone clicks on it, they would see the Web page named welcome.htm, which is located in the dicko folder on the Web server computer whose address is netletter.com--just as if they had typed the address into the Web browser by hand. (Internet addresses are also called Uniform Resource Locators, or URLs by techie types, by the way.)

HREF stands for Hypertext Reference and is called an attribute of the <A> tag. You'll learn more about attributes in Chapter 5, "Text Formatting and Alignment."



--------------------------------------------------------------------------------
Just A Minute: As you may know, you can leave out the http:// or http://www. at the front of any address when typing it into most Web browsers. You cannot leave that part out when you type an address into an <A HREF> link on a Web page, however.
--------------------------------------------------------------------------------



--------------------------------------------------------------------------------
Time Saver: One thing you can often leave out of an address is the actual name of the HTML page, because most computers on the Internet will automatically pull up the home page for a particular address or directory folder. For example, you can use http://netletter.com to refer to the page located at http://netletter.com/welcome.htm because my server computer knows welcome.htm is the page you should see first. (See Chapter 4, "Publishing Your HTML Pages.")
--------------------------------------------------------------------------------

Figure 3.1 includes a number of <A> tags, which show up as underlined links in Figure 3.2. For example, clicking on the words "What happens to a Coke can if you freeze it?" in Figure 3.2 will take you to the page located at http://www.wp.com/marius/coke.html, as shown in Figure 3.3.

Figure 3.1. Words between <A> and </A> tags will become links to the addresses given in the HREF attributes.

Figure 3.2. Underlined links

Figure 3.3. Clicking on "What happens to a Coke can if you freeze it?" in Figure 3.2 retrieves this page from the Internet.



--------------------------------------------------------------------------------
Time Saver: You can easily transfer the address of a page from your Web browser to your own HTML page using the Windows or Mac Clipboard. Just highlight the address in the Location, Address, Bookmark Properties, or Edit Favorites box in your Web browser, and select Edit | Copy (or press Ctrl+C). Then type <A HREF=" and select Edit | Paste (Ctrl+V) in your HTML editor.
--------------------------------------------------------------------------------


--------------------------------------------------------------------------------
Coffee Break: At the 24-Hour HTML Café, you can explore a list of useful HTML learning resources on the Web from: http://www.mcp.com/sams/books/235-8/cafe3.htm
--------------------------------------------------------------------------------


Before you follow the links on that page, view the document's HTML source to see a simple example of how to put hypertext links to work.

Linking Between Your Own Pages
When you create a link from one page to another page on the same computer, it isn't necessary to specify a complete Internet address. If the two pages are in the same directory folder, you can simply use the name of the HTML file, like this:

<A HREF="pagetwo.htm">Click here to go to page 2.</A>


As an example, Figures 3.4 and 3.5 show a quiz page with a link to the answer page in Figure 3.6. The answers page contains a link back to the quiz page.

Figure 3.4. Because this page links to another page in the same directory, the filename can be used in place of a complete address.

Figure 3.5. This is the answer.htm file, and Figure 3.4 is question.htm, which this page links back to.

Figure 3.6This is the question.htm file listed in figure 3.4 and referred to by the link in Figure 3.5



Using just filenames instead of complete Internet addresses saves you a lot of typing. And more importantly, the links between your pages will work properly no matter where the pages are located. You can test the links while the files are still right on your computer's hard drive. Then you can move them to a computer on the Internet, or to a CD-ROM or DVD disk, and all the links will still work correctly.



--------------------------------------------------------------------------------
Just A Minute: There is one good reason to sometimes use the complete address of your own pages in links. If someone saves one of your pages on his own hard drive, any links to your other pages from that page won't work unless he includes full Internet addresses. I like to include a link with the full address of my main "home" page at the bottom of every page, and use simple filenames or relative addresses in all the rest of the links.
--------------------------------------------------------------------------------

Relative Addresses
If you have many pages, you'll want to put them in more than one directory folder. In that case, you still shouldn't use the full Internet address to link between them. You can use relative addresses, which include only enough information to find one page from another.

A relative address describes the path from one Web page to another, instead of a full (or "absolute") Internet address.

For instance, suppose you are creating a page named zoo.htm in a directory folder named webpages on your hard drive. You want to include a link to a page named african.htm, which is in a sub-folder named elephants within webpages. The link would look like this:

<A HREF="elephants/african.htm">Learn about African elephants.</A>




--------------------------------------------------------------------------------
Just A MInute: Notice that the / (forward-slash) is always used to separate directory folders in HTML. Don't use the \ (backslash) normally used in Windows and DOS!
--------------------------------------------------------------------------------

The african.htm page might contain a link back to the main zoo.htm page:

<A HREF="../zoo.htm">Return to the zoo.</A>


The double-dot ( .. ) is a special code which means "the folder containing the current folder." (The .. means the same thing in DOS, Windows, MacOS, and UNIX.)

You can then move these pages to another directory folder, disk drive, or Web server without changing the links, as long as you always put african.htm inside a sub-folder named elephants.

Relative addresses can span quite complex directory structures if necessary; Chapter 21, "Organizing Multiple Pages," offers more detailed advice for organizing and linking among large numbers of Web pages. To Do: You probably created a page or two of your own while working through Chapter 2, "Creating a Web Page." Now is a great time to add a few more pages and link them together.

Use a home page as a main entrance and central "hub" to which all your other pages are connected. If you created a page about yourself or your business in Chapter 2, use that as your home page. You also might like to make a new page now for this purpose.

On the home page, put a list of <A HREF> links to the other HTML files you've created (or plan to create soon). Be sure that the exact spelling of the filename, including any capitalization, is correct in every link.

On every other page, include a link at the bottom (or top) leading back to your home page. That makes it simple and easy to navigate around your "site."

You may also want to include a list of links to sites on the Internet, either on your home page or a separate "hotlist" page. People often include a list of their friends' personal pages on their own home page. (Businesses, however, should be careful not to lead potential customers away to other sites too quickly--there's no guarantee they'll come back!)
Remember to use only filenames (or relative addressing) for links between your own pages, but full Internet addresses for links to other sites.
Summary
The <A> tag is what makes hypertext "hyper." With it, you can create clickable links between pages, as well as links to specific anchor points on any page.

When creating links to other people's pages, include the full Internet address of each page in an <A HREF> tag. For links between your own pages, include just the filenames and enough directory information to get from one page to another.

Table 3.1 summarizes the two attributes of the <A> tag discussed in this chapter. Table 3.1. HTML tags and attributes covered in Chapter 3. Tag Attribute Function
<A>...</A> With the HREF attribute, creates a link to another document or anchor; with the NAME attribute, creates an anchor that can be linked to.
HREF="..." The address of the document and/or anchor point to link to.
NAME="..." The name for this anchor point in the document.


Q&A
Q When I make links, some of them are blue and some of them are purple. Why? And how come most of the links I see on the Internet aren't blue and purple?

A A link will appear blue to anyone who hasn't recently visited the page it points to. Once you visit a page, any links to it will turn purple. These colors can be (and often are) changed to match any color scheme a Web page author wants, so many links you see on the Web won't be blue and purple. (Chapter 13, "Backgrounds and Color Control," tells how to change the colors of text and links on your Web pages.)

Q What happens if I link to a page on the Internet and then the person who owns that page deletes or moves it?

A That depends on how that person has set up his server computer. Usually, people will see a message when they click on the link saying "Page not found" or something to that effect. They can still click the back button to go back to your page.
Quiz Questions
1. Your best friend from elementary school finds you on the Internet and says he wants to trade home page links. How do you put a link to his page at www.cheapsuits.com/~billybob/ on your page?

2. Your home page will be at http://www.mysite.com/home.htm when you put it on the Internet. Write the HTML code to go on that page so that when someone clicks on the words "All about me," they see the page located at http://www.mysite.com/mylife.htm.

3. You plan to publish a CD-ROM disc containing HTML pages. How do you create a link from a page in the \guide directory folder to the \guide\maine\katahdin.htm page?

4. How about a link from \guide\maine\katahdin.htm to the \guide\arizona \superstitions.htm page?
 
 
 
 
The God Father
Developer's Avatar

Reply With Quote
 
Join Date: Jul 2008
Location: NDC
Posts: 5,425
16-07-2008, 11:19 PM
 
Hour 4
Publishing Your HTML Pages
Here it is, the chapter you've been waiting for! Your Web pages are ready for the world to see, and this chapter explains how to get them to appear before the eyes of your intended audience.

The most obvious avenue for publishing Web pages is, of course, the Internet. Yet you may want to limit the distribution of your pages to a local intranet within your organization instead of making them available to the general public. You may also choose to distribute your Web pages on CD-ROMs, floppy disks, Zip disks, or the new DVD-ROM disks.

This chapter covers all of these options, and offers advice on designing your pages to work best with the distribution method you choose.


--------------------------------------------------------------------------------
New Term: An intranet is a private network with access restricted to one organization, but which uses the same standards and protocols as the global public Internet. To Do: Before you read about publishing your pages, you should give some thought to which methods of distribution you will be using. You probably already know if you're going to be publishing on a corporate intranet, but the decision of whether to publish on the Internet or on disk can be harder to make.
--------------------------------------------------------------------------------

If you want your pages to be visible to as many people as possible all over the world, Internet publishing is a must. But don't rule out other distribution methods; you can easily adapt Internet-based pages for distribution on disks and/or local networks.

If you want to reach a specific group of people who have computers, but may not be on the Internet yet, publish your pages on floppy disk (if there aren't very many of them) or CD-ROM (if you have an extensive site). But first, consider seriously whether you can present the same information on good old-fashioned paper.

If you want to provide very large graphics, multimedia, or other content that would be too slow to transfer over today's modems, consider publishing on a CD-ROM. You can easily link the CD-ROM to an Internet Web site, and offer the CD-ROM to people who find you through the Internet, but want the "full experience."
Publishing Web Pages on Disk
Unless you were hired to create documents for a company intranet, you have probably assumed that the Internet is the best way to get your pages in front of the eyes of the world. But there are three major incentives for considering distribution on some form of disk instead:

Currently, more people have disk drives than Internet connections.

Disks can deliver information to the computer screen much faster than people can download it from the Internet.

You can distribute disks to a select audience, whether or not they are connected to the Internet or any particular intranet.
In the not-too-distant future, as Web-enabled televisions and high-speed networks become more commonplace, these advantages may disappear. But for now, publishing on disk can be an excellent way to provide a bigger, faster, and more tightly targeted Web presentation than you could on today's Internet.

Publishing on 1.44MB floppy disks or 100MB Zip disks is simply a matter of copying files from your hard disk with any file management program. You just need to keep in mind that any links starting with http:// will only work if and when someone reading your pages is also connected to the Internet. The cost is currently about $0.50 per floppy disk, or $10 per Zip disk, plus any delivery or mailing costs.



--------------------------------------------------------------------------------
Time Saver: Never use drive letters (such as C in <A HREF> link tags on your Web pages or they won't work when you copy the files to a different disk. Refer back to Chapter 3, "Linking to Other Web Pages," for more details on how to make links that will work both on disk and on the Internet.
--------------------------------------------------------------------------------

Publishing on CD-ROM or the new DVD-ROM disks isn't much more complicated; you either need a drive (and accompanying software) capable of creating the disks, or you can send the files to a disk mastering and duplication company. Costs for CD-ROM duplication vary a lot depending on how many disks you need. For less than a hundred CD-ROMs, it may cost more than $10 per disk. But for thousands of copies, expect to pay less than $1 each plus delivery or mailing costs. DVD-ROM pricing hasn't settled down yet, but it will eventually be similar to CD-ROM pricing.

Setting Up an Internet Web Site
To make an HTML page part of the publicly accessible World Wide Web, you need to put it on a Web server (a computer permanently connected to the Internet and equipped to send out Web pages upon request). If you run your own Web server, this procedure is simply a matter of copying the file to the right directory. But most people use a Web server run by an Internet service provider (ISP) to host their pages.

Almost all service providers that offer Internet access also offer space to place your own personal Web pages for little or no additional cost. However, if you plan (or even hope) to attract large numbers of people, you should pay a little more money to get a fully supported business site with a major Internet service provider.



--------------------------------------------------------------------------------
Time Saver: Don't think that you have to use the same local company that provides you with Internet access to host your pages. If you run a busy business Web site, you may save a lot of money and get more reliable service from a company in another city. For example, I use a company in Vermont to access the Internet, but my Web site is hosted by a different company in Boston. To "comparison shop" the hosting services offered by various Internet service providers, go to the list of ISPs at: http://thelist.com/
--------------------------------------------------------------------------------


Prices for a business site start well under $100 per month, but you usually pay more when lots of people start viewing your pages. For a site with about a hundred different Web pages, I have paid as little as $40 per month when a few thousand people looked at my pages, and as much as $2,000 per month when hundreds of thousands of people looked at my pages.



--------------------------------------------------------------------------------
Just A Minute: One of the most important choices you'll need to make when you set up a Web site is the name you want to use as the address of the site. If you aren't willing to pay $100 up front and $50 a year to maintain your own domain name, the address of your site will include the name of your Internet service provider (example: http://www.shore.net/~smith/). If you're willing to pay for it, you can pick any name that isn't already in use by another company (example: http://mister-smith.com/) You can check to see if the name you want is already in use at http://domain-registration.com/ (Or you can just enter the name in your Web browser to see if you get a page.) Once you find a name that isn't already taken, ask your Internet service provider to help you apply for that name as soon as possible.
Transferring Pages to a Web Server
When a Web server computer sends Web pages to people through the Internet, it uses an information exchange standard called Hypertext Transfer Protocol (HTTP). To upload a page to your Web site, however, you need software that uses an older communications standard called File Transfer Protocol (FTP).


--------------------------------------------------------------------------------
New Term: File Transfer Protocol is the standard that your file transfer software must adhere to when sending files to a Web server. The server then sends those files out to anyone who asks for them using the Hypertext Transfer Protocol.
--------------------------------------------------------------------------------

Netscape Navigator can receive files using both the HTTP and FTP standards. It can also send files using FTP, so you can use it to upload your pages to a Web server. Follow these steps:

1. Enter the address of your Web directory in Netscape Navigator's Location box, as in the following example:
ftp://myname:mypassword@myisp.net/home/web/wherever/

Put your username and password for accessing the site instead of myname and mypassword, your Internet service provider's address instead of myisp.net, and the top-level directory where your Web pages reside instead of /home/web/wherever/.

2. Drag the icons for the HTML and graphics files you want to upload from any Windows 95 file management program (such as Windows Explorer) into the Netscape Navigator window.

3. A dialog box appears and asks you whether you want to upload the files. Click OK, and wait while the files are transferred.

4. Test your page by clicking on the HTML file you just uploaded in the FTP directory listing (in the Netscape window). You're on the Web!
Even though Netscape Navigator 2.0 or 3.0 can send files to any Web server on the Internet, specialized FTP programs such as WS_FTP or CuteFTP offer much more control for managing your Web pages. For example, Navigator doesn't give you any way to delete an old Web page that you want to get rid of, or change the name of a Web page on the server computer. You'll definitely want a specialized FTP program to maintain your Web site.

Figure 4.1 shows one of the most popular FTP programs, CuteFTP for Windows. You can download a free copy of CuteFTP (see the following "To Do:" section), though CuteFTP does require a modest registration fee for business users. (See the documentation that comes with the program for details.)

Similar programs are available for Macintosh computers (Fetch is a popular favorite), and FTP utilities come pre-installed on most UNIX computers. You can find these and other FTP programs at http://www.shareware.com.

Figure 4.1. CuteFTP is a powerful and user-friendly FTP program that individuals can use for free.


To Do: I recommend that you download CuteFTP now and use it to send some files to your own Web site as you read on (if you have a Web site set up, that is).

Go to the CuteFTP home page at http://www.cuteftp.com/ and follow the Download CuteFTP links.

Once the download is complete, run the self-extracting .exe program, which will install the CuteFTP program.
No matter which FTP program you choose, transferring your Web pages to a Web server involves the following steps. (The steps are illustrated here with CuteFTP, but other FTP programs work similarly.)

1. Before you can access the Web server, you must tell your FTP program its address, as well as your account name and password. In CuteFTP, select a category for your site in the FTP Site Manager window (Personal FTP Sites in Figure 4.2), and click Add site to access the FTP Site Edit dialog box in Figure 4.3.
Figure 4.2. CuteFTP includes an intuitive FTP Site Manager, though most Web page authors only need a single FTP site entry.

Figure 4.3. Clicking on Add site or Edit site in Figure 4.2 brings up this dialog box.


2. Here's how to fill in each of the items in Figure 4.3.
Site Label is the name you'll use to refer to your own site. Nobody else will see this name, so enter whatever you want.

Host Address is the FTP address of the Web server that you need to send your Web pages to. This usually (but not always) starts with ftp. Notice that it may or may not resemble the address that other people will use to view your Web pages. The Internet service provider that runs your Web server will be able to tell you the correct address to enter here.
User ID and Password are also issued by the company that runs the Web server. Be aware that CuteFTP (and most other FTP programs) will remember your password automatically, which means that anyone who has physical access to your computer may be able to modify your Web site.

You should set the Login type to Normal unless somebody important tells you otherwise. (The Anonymous setting is for downloading files from public FTP services that don't require user IDs or passwords.)
Set the Transfer type to Auto-Detect. (This will automatically send HTML and other text files using a slightly different protocol than images and other non-text files, to ensure complete compatibility with all types of computers.)
For the Initial Remote Directory, fill in the name of the main directory folder on the Web server where your Web pages will be located. The people who run your Web server will tell you the name of that directory. (In some cases, you don't need to enter anything here, because the Web server computer will automatically put you in the directory when you connect to it.)

For the Initial Local Directory, enter the drive and directory folder on your computer's hard drive, where you keep your Web pages.
Normally, you won't need to change the Port, Retry, Delay, Max Safe Index Size, and Host Type settings unless you experience problems with your connection. If that happens, have your service provider help you figure out the best settings. You should also make sure that Use firewall and the other check box options are unchecked unless someone in the know says to check them.

You can enter any Comments or reminders to yourself that you like. Only you will see them.

3. When you click OK, you'll go back to the window shown in Figure 4.2. Make sure you are connected to the Internet, and click Connect to establish a connection with the Web server computer.

Most server computers issue a short message to everyone who connects to them. Many FTP programs ignore this message, but CuteFTP presents it to you as shown in Figure 4.4. It seldom says anything important, so just click OK.
Figure 4.4. CuteFTP displays the "boilerplate" message that some server computers send whenever you connect to them.


4. Once you're connected to the server, you'll see two lists of files, as shown earlier in Figure 4.1. The left window pane lists the files on your computer, while the right pane lists the files on the server computer.

To transfer a Web page to the server, select the HTML file and any accompanying image files in the left window. (Remember that you can hold down the Ctrl key and click the mouse to select multiple files in any Windows program.) Then select Commands | Upload, as in Figure 4.5, or click on the Upload button on the toolbar.

As you can see, the same menu contains commands to delete or rename files (on either your computer or the server), as well as commands to make and change directory folders.


--------------------------------------------------------------------------------
Time Saver: Most Web servers have a special name for the file that should be sent if someone doesn't include a specific filename when they request a page. For example, if you go to http://netletter.com/, my Web server will automatically give you the welcome.htm file. Other Web servers use different names for the default file, such as index.html. Be sure to ask your service provider the default filename so you can give your home page that name.
--------------------------------------------------------------------------------

Figure 4.5. To send files to the server, select Commands | Upload in CuteFTP.


5. That's all there is to it! In most cases, you can immediately view the page you just put on the Web server using Netscape Navigator (see Figure 4.6) or Microsoft Internet Explorer.
Figure 4.6. Most Web servers make pages immediately available on the Internet seconds after you upload them.

6. When you're done sending and modifying files on the Web server, select FTP | Disconnect to close the connection.
The next time you need to upload some Web pages, you won't need to fill in all the information in step 2. You can just click Connect, select the pages you want to send, and click on the Upload button.



--------------------------------------------------------------------------------
Just A Minute: Most Web servers are set up so that any documents placed onto them are immediately made available to the entire World Wide Web. However, some require that users manually change file permission settings, which control who is allowed to access individual files. Your Internet service provider can tell you exactly how to change permission settings on their server and whether it's necessary to do so.
--------------------------------------------------------------------------------

Putting Web Pages on an Intranet
The procedure outlined above for sending pages to a public Internet server is fairly standard. But the internal workings of private corporate intranets vary considerably from company to company. In some cases, you may need to use an FTP program to send files to an intranet server. In others, you may be able to transfer files using the same file management program you use on your own computer. You may also need to adjust permission settings, or make special allowances for the firewall that insulates a private intranet from the public Internet.

About all I can tell you here in this book about putting files on your company's intranet is to consult with your systems administrator. He can help you put your Web pages on the company server in the way that best ensures their accessibility and security.

Testing Your Pages
Whenever you transfer Web pages to a disk, Internet site, or intranet server, you should immediately test every page thoroughly.

The following checklist will help you make sure everything on your pages behaves the way you expected.

1. Before you transfer the pages, follow all of these ten steps to test the pages while they're on your hard drive. After you transfer the pages to the master disk or Web server, test them again--preferably through a 28.8Kbps modem connection, if your pages are on the Internet.

2. Do each of the following steps with the latest version of Netscape Navigator, the latest Microsoft Internet Explorer, and at least one older browser such as DOS Lynx or Netscape Navigator 2.0.

3. Make sure the computer you're testing with is set to a 16-color video mode, or at most a 256-color mode. (Pages look better in higher color modes, but you want to see the "bad news" of how they'll look to most people.)

4. If possible, use a computer with 800x600 resolution for testing purposes, but adjust the size of the browser window to exactly 640x480 pixels. On each page, use the Maximize button on the corner of the window to switch back and forth between full 800x600 resolution and 640x480 resolution. If pages look good at these two resolutions, they'll probably look fine at larger resolutions, too. (Additional testing at 1024x768 or 1600x1200 resolution isn't a bad idea, though.)

5. Turn off auto image loading in Netscape Navigator before you start testing, so you can see what each page looks like without the graphics. Check your ALT tag messages, then hit the Load Images button on the toolbar to load the graphics and review the page carefully again.

6. Use Microsoft Internet Explorer's Font Size button (the big A on the toolbar) to look at each page at all font sizes, to ensure that your careful layout doesn't fall to pieces.

7. Start at the home page and systematically follow every link. (Use the Back button to return after each link, then click the next link on the page.)

8. Wait for each page to completely finish loading, and scroll down all the way to make sure all images appear where they should.

9. If you have a complex site, it may help to make a checklist of all the pages on your site to make sure they are all tested.

10. Time how long it takes each page to load through a 28.8Kbps modem, preferably when connected through a different Internet service provider than the one who runs the Web server. Then multiply that time by two to find out how long 14.4Kbps modem users will need to wait to see the page. Is the information on that page valuable enough to keep them from hitting the Stop button and going elsewhere before the page finishes loading?
If your pages pass all those tests, then you can be pretty certain that they'll look great to every Internet surfer in the world.

Summary
This chapter gave you the basic knowledge you need to choose between the most common distribution methods for Web pages. It also guided you through the process of placing Web pages on a Web server computer using freely available file transfer software. Finally, it offered a checklist to help you thoroughly test your Web pages once they are in place.

Q&A
Q When I try to send pages to my Web site from home, it works fine, but when I try it from the computer at work, I get error messages. Any idea what the problem might be?

A The company where you work probably has a firewall, which is a layer of security protecting their local network from tampering via the Internet. You will need to set some special configuration options in your FTP program to help it get through the firewall when you send files. Your company's network administrator can help you with the details.

Q I don't know which Internet service provider to pick to host my pages--there are so many! How do I choose?

A Obviously, you should compare prices of the companies listed at http://thelist.com that provide hosting services, but you should also ask for the names of some customers with sites about the same size as you plan yours to be, and ask them (via e-mail) how happy they are with the company's service and support. Also, make sure that your provider has at least two major (T3 or bigger) links to the Internet, preferably provided to them by two different network companies.

Q All the tests you recommend would take longer than creating my pages! Can't I get away with less testing?

A If your pages aren't intended to make money or provide an important service, then it's probably not a big deal if they look funny to some people or produce errors once in a while. In that case, just test each page with a couple of different window and font sizes and call it good. However, if you need to project a professional image, there is no substitute for rigorous testing.

Q I wanted to name my site jockitch.com, but Proctor and Gamble beat me to it. Is there anything I can do?

A Well, if your company was named Jockitch, Inc., before Proctor and Gamble registered the word as a trademark, you could always try suing them. (Good luck.) Yet even if you don't have the budget to take on their lawyer army, there may be hope. Many new three-letter extensions for site names will probably soon be approved for use, so you may be able to get jockitch.inc or jockitch.biz (if P&G doesn't scoop you again).
Quiz Questions
1. How do you put a few Web pages on a floppy disk?

2. Suppose your Internet service provider tells you to put your pages in the /top/user/~elroy directory at ftp.bigisp.net, your username is elroy, and your password is rastro. You have the Web pages all ready to go in the \webpages folder on your C drive. Where do you put all that information in CuteFTP so you can get the files on the Internet?

3. What address would you enter in Netscape Navigator to view the Web pages you uploaded in Question 2?

4. If the following Web page is named mypage.htm, which files would you need to transfer to the Web server to put it on the Internet?
<HTML><HEAD><TITLE>My Page</TITLE></HEAD>

<BODY BACKGROUND="joy.gif">

<IMG SRC="me.jpg" ALIGN="right">

<H1>My Web Page</H1> Oh happy joy I have a page on the Web!<P>

<A HREF="otherpage.htm">Click here for my other page.</A>

</BODY></HTML>
 
 
 
 
The God Father
Developer's Avatar

Reply With Quote
 
Join Date: Jul 2008
Location: NDC
Posts: 5,425
16-07-2008, 11:20 PM
 
Hour 6
Font Control and Special Characters
This chapter gives you the power to decide what size, color, and typeface should be used to display any text on your Web pages. It also shows you how to create special symbols, such as the copyright mark and European language characters such as the é in Café.

Font Size and Color
To set the size and color of any text on a Web page, use the <FONT> tag:

<FONT SIZE=5 COLOR="purple">This text will be big and purple.</FONT>


The SIZE attribute can take any value from 1 (tiny) to 7 (fairly big), with 3 being the normal default size.

The COLOR attribute can take any of the following standard color names: black, white, red, green, blue, yellow, aqua, fuchsia, gray, lime, maroon, purple, navy, olive, silver, or teal.



--------------------------------------------------------------------------------
Just A Minute: The <BIG> and <SMALL> tags discussed in Chapter 5, "Text Formatting and Alignment," produce effects that you can also achieve with <FONT SIZE>. <FONT SIZE> gives you more precise control over the size, but <BIG> and <SMALL> may work with some older browsers that don't support the <FONT> tag.
--------------------------------------------------------------------------------

The actual size and exact color of the fonts will depend on each reader's screen resolution and preference settings, but you can be assured that SIZE=6 will be a lot bigger than SIZE=2, and that COLOR="red" will certainly show its fire.



--------------------------------------------------------------------------------
Just A Minute: You'll learn more about controlling the color of the text on your pages in Chapter 13, "Backgrounds and Color Control." That chapter also shows you how to create your own custom colors and control the color of text links.
--------------------------------------------------------------------------------

Choosing a Typeface
With the 3.0 versions of both Navigator and Internet Explorer, Netscape and Microsoft have added another extremely powerful form of font control: the <FONT FACE> attribute. This allows you to specify the actual typeface that should be used to display text--and has been the source of much rejoicing among Webmasters who are awfully sick of Times and Courier!

The page in Figures 6.1 and 6.2 uses these font controls to present a warmly welcoming homestyle site.

The code to set the typeface used for the headings in Figure 6.1 is:

<FONT FACE="Copperplate Gothic Bold" SIZE=5 COLOR="red">


If Netscape Navigator or Microsoft Internet Explorer can find a font named Copperplate Gothic Bold on a user's system, that font is used. Otherwise, they will use the default font (usually Times New Roman). Browsers other than Navigator 3.0 and Internet Explorer 3.0 will ignore the FONT FACE attribute and display the fonts they always use.

You can also specify a "second choice" font, for people who don't have your first choice font installed on their computer. For example, I used the following tag to choose the body text in Figure 6.1:

<FONT FACE="Lucida Handwriting, Comic Sans MS" SIZE=4 COLOR="maroon">


Figure 6.1. The <FONT> tags give you control over the size, color, and typeface of any text.

Figure 6.2. If you have the Copperplate Gothic Bold and Lucida Handwriting fonts installed on your computer, they will be used to display the page in Figure 6.1.

Anyone who has Comic Sans MS (a very common font) installed, but doesn't have Lucida Handwriting (a slightly less common font), will see the body text as it appears in Figure 6.3.

Figure 6.3 also shows what the headings look like to people who don't have the Copperplate Gothic Bold font.

Figure 6.3. Someone without the two fonts specified in Figure 6.1 (but with Comic Sans MS) would see this instead of Figure 6.2.

Currently, only fonts that each user happens to have on his or her system will show up, and you have no control over which fonts are installed. Furthermore, the exact spelling of the font names is important, and many common fonts go by several slightly different names. Extensions to HTML will soon support a new, highly compact font format that can be automatically downloaded along with your pages to solve these problems. For now, you just have to stick to the most common fonts and make sure your pages still look acceptable in Times New Roman.

Figure 6.4 shows the most common TrueType fonts, many of which are also available in PostScript format. Microsoft offers a number of these fonts available for free download from this site:

http://www.microsoft.com/truetype/


Microsoft has also included these fonts (and variations on them) in Windows and other popular software packages, as indicated in Figure 6.4.



--------------------------------------------------------------------------------
Time Saver: To make all the text in Figure 6.4 larger, I put <BASEFONT SIZE=5> just after the <BODY> tag. (I did the same thing in Figure 6.5, too.) <BASEFONT> is just a time-saving tag for setting the overall size of all text in a document. The size of all headings will also be relative to the <BASEFONT SIZE>. This tag can't take any attributes other than SIZE, and doesn't require a closing </BASEFONT> tag.
--------------------------------------------------------------------------------

Figure 6.4. The most popular TrueType fonts are good bets for inclusion in your Web pages. (Arial is especially reliable.)

If you want to use a font on your Web page that isn't on this list, don't be afraid to do so! The user will never see an error message if the font can't be found; the worst thing that could happen is that the user won't see your special font, but will still see the text in the next best font that can be found. If one of the fonts in Figure 6.4 has a similar feel to the one you want, include it as a "second choice" as I did with Comic Sans MS in the preceding example. To Do: All the Web pages associated with a single "site" should usually use the same fonts and text color scheme. You don't need to be a professional typographer to make good font choices if you follow the guidelines below.

If you are a professional typographer, you know how to break these rules and still make a page look great. If you try to deviate from them without much experience, however, your pages are likely to stand out as very "unprofessional" looking, even to people who can't articulate exactly why.

Always choose a typeface with serifs (those little beveled points on the edges of the letters) for the main body of your text. The serif typefaces that a significant number of people are likely to have installed are Times New Roman, Georgia, Book Antiqua, and Calisto MT.

For headings, choose a heavy typeface without serifs, such as Arial Black, Impact, or Copperplate Gothic Bold. For captions and other short passages of text, either use your body text font or a "light" version of your heading font, such as Arial or Copperplate Gothic Light.
Medium-weight fonts without serifs are suitable for both headings and short passages of text. These include Arial, Trebuchet MS, Verdana, Lucida Sans, Lucida Sans Unicode, and News Gothic MT.
Use one color for all body text, and either the same color or a "stronger" complementary color for all headings and captions. Unless you are an experienced graphics designer, stay with a dark color such as black, blue, maroon, olive, or purple for body text, and put it on a contrasting, light background. If you want a wilder color, headings (and graphics images) are the best place for it.

Use ornamental fonts like Comic Sans MS, Lucida Handwriting, and OCR A Extended very sparingly and for main headings or highly stylistic pages only. Better yet, reserve these fonts for use in graphics images where you can also accent them with textures, shadows, or other effects.

If your company has a standard set of TrueType or PostScript fonts for all communications, specify those fonts as the first choice in your <FONT FACE> tags. However, you should always include one or two "second choice" fonts from Figure 6.4 as well.
Special Characters
Most fonts now include special characters for European languages, such as the accented e in Café. There are also a few mathematical symbols and special punctuation marks such as the circular
* bullet.

You can insert these special characters at any point in an HTML document by looking up the appropriate codes in Table 6.1. (This table includes only the most commonly used codes for English-language usage. You'll find a complete table of all special characters for European language fonts in Appendix B, "HTML Quick Reference.")

For example, the word Café would look like this:

Café


Each symbol also has a mnemonic name that might be easier to remember than the number. Another way to write Café, for instance, is:

Caf&eacute;


Notice that there are also codes for the angle brackets (< >), quote symbol ("), and ampersand (&) in Table 6.1. You need to use the codes if you want these symbols to appear on your pages, because the Web browser will otherwise interpret them as HTML commands.

In Figures 6.5 and 6.6, several more of the symbols from Table 6.1 and Appendix B are shown in use.

Figure 6.5. Special character codes begin with &# and end with ;.

Figure 6.6. This is how the HTML page in Figure 6.5 will look in most (not all) Web browsers.



--------------------------------------------------------------------------------
Time Saver: Looking for the copyright (Š) or registered trademark (Ž) symbols? The codes you need are &copy; and &reg; respectively. To create an unregistered trademark (&tm symbol, use <SUPER>TM</SUPER> or <SMALL><SUPER>TM</SUPER></SMALL> for a smaller version.
--------------------------------------------------------------------------------

Table 6.1 lists some of the special characters you might need to use on your Web page.

Table 6.1. Important special characters. Character Numeric Code Code Name Description
" " &quot; Quotation mark
& & &amp; Ampersand
< < &lt; Less than
> > &gt; Greater than
cents ˘ &cent; Cent sign
[sterling] Ł &pound; Pound sterling
| Ś &brvbar; or brkbar; Broken vertical bar
SS § &sect; Section sign
Š Š &copy; Copyright
Ž Ž &reg; Registered trademark
deg. ° &deg; Degree sign
+/- ą &plusmn; Plus or minus
2 ˛ &sup2; Superscript two
3 ł &sup3; Superscript three
. ˇ &middot; Middle dot
1 š &sup1; Superscript one
[dieresis] ź &frac14; Fraction one-fourth
' ˝ &frac12; Fraction one-half
p ž &frac34; Fraction three-fourths
&AElig; Ć &AElig; Capital AE ligature
&aelig; ć &aelig; Small ae ligature
&Eacute; É &Eacute; Accented capital E
é é &eacute; Accented small e
x × Multiply sign
/ ÷ Division sign




--------------------------------------------------------------------------------
Just A Minute: Some older Web browsers will not display many of the special characters in Table 6.1. Some fonts may also not include all of these characters. See Table B.1 in Appendix B for a complete list of special symbols and European language characters.
--------------------------------------------------------------------------------

The Future of Web Fonts
There are two major advances in the works which promise to revolutionize Web page typography. Neither of these advances is ready for widespread use today, but you should be aware of them and plan on learning about them when the revolution hits.

Cascading Style Sheets (CSS) will be part of the next HTML standard, but they work very differently from normal HTML. You will be able to create a special document containing only information about the fonts and formatting to be used on a Web page. This document, called a style sheet, can then be linked to any number of Web pages so they will all have a consistent style.

Style sheets offer two huge time-saving advantages. Because a single style sheet may control the appearance of many pages, you can change the look and feel of your entire Web site just by changing a single style sheet. For complex Web sites, this might save you from spending hours modifying each page individually. The second big advantage of style sheets is that they will allow more precise control over the appearance of your pages than any previous version of HTML. You will be able to set the exact line spacing, font metrics, margins, and paragraph indentation for any text. You'll also have the ability to put colored boxes behind any text, and wield more control over multiple-column text than you can today.

When you want a document, or a part of a document, to be a little different, you can put style information at any point in that document to override part of its style sheet. (The idea is that styles "cascade" down from the style sheet to the document, and then to specific parts of the document. At any point in that cascade, new styles may "flow in." That's why they're called "cascading style sheets.")



--------------------------------------------------------------------------------
Just A Minute: If you'd like to start learning about style sheets today, Microsoft Internet Explorer 3.0 supports some of the simpler aspects of HTML style sheets. The Internet Explorer Web site at http://www.microsoft.com/ie/ offers a quick style sheet tutorial. Upcoming versions of Microsoft Internet Explorer and Netscape Navigator promise full support of the new CSS standard.
--------------------------------------------------------------------------------

The other revolutionary advance in typography that's afoot is font embedding. This will allow you to retrieve the actual typeface along with a Web page, so even people who don't have the correct font preinstalled on their computer will see it on the page.

There has been a standard for embedding TrueType fonts in documents for a while, but it doesn't yet include some features that are necessary for it to work with Web pages. The most important feature to be added is font compression, which minimizes the file size of fonts so they can be transferred over the Internet quickly. Transferring only the letterforms actually used in a document and allowing font publishers to control how the font can be reused are also key features to make font embedding a reality.

The upcoming OpenType font standard will also combine both TrueType and PostScript (the two competing font formats) into a single standard.

Support for font embedding should appear in Netscape Navigator and Microsoft Internet Explorer at the same time as style sheet support. These two technologies together will dramatically expand your ability to control the appearance of your Web pages.


--------------------------------------------------------------------------------
Coffee Break: At the 24-Hour HTML Café, I chose Georgia as the main font for body text. Because I wanted to use fonts that most people don't have installed for headings, I used Paint Shop Pro to render all headings as graphics. When embedded fonts become a reality, I may choose to replace some of the graphics at the Café with regular headings that use the Parisian and Present Script fonts.
--------------------------------------------------------------------------------

In the meantime, check it out at:

http://www.mcp.com/sams/books/235-8/cafe6.htm


(You'll also notice that I used one of the codes discussed under the Special Characters section to finally spell Café with the accent-acute it deserves!)

If you go to the address above and still see most of the text as Times New Roman, you don't have Georgia installed on your computer yet. I highly recommend that you download it from Microsoft by going to http://www.microsoft.com/truetype/ and following the "free Web fonts" link. Georgia will be included with future versions of Microsoft Internet Explorer, and is likely to become a popular font on the Web due to its excellent readability and stylish appearance at low resolutions.

While you're at Microsoft, pick up Verdana, Trebuchet, and whatever new free fonts they have, too. Then go back to the 24-Hour HTML Café for links to some sample pages that use them.

Summary
This chapter has shown you how to control the size, color, and typeface of any section of text on a Web page. This chapter also provided an overview of some exciting advances in font control that are just around the bend, including HTML style sheets and font embedding.

Table 6.2 summarizes all the tags and attributes covered in this chapter. (See Table B.1 in Appendix B for special character codes.)

Table 6.1 Summary of tags and attributes covered in Chapter 6. Tag Attribute Function
<FONT>...</FONT> Controls the appearance of the enclosed text.
SIZE="..." The size of the font, from 1 to 7. Default is 3. Can also be specified as a value relative to the current size; for example, +2.
COLOR="..." Changes the color of the text.
FACE="..." Name of font to use if it can be found on the user's system. Multiple font names can be separated by commas, and the first font on the list that can be found will be used.
<BASEFONT> Sets the default size of the font for the current page.
SIZE="..." The default size of the font, from 1 to 7.


Q&A
Q How do I find out the exact name for a font that I have on my computer?

A On a Windows or Macintosh computer, open the Control Panel and click on the Fonts folder. The TrueType fonts on your system will be listed. Use the exact spelling of font names when specifying them in the <FONT FACE> tag. Windows 95 users can view all the characters in any font with the Character Map utility, usually located in the Accessories folder.

To find the name of PostScript fonts in Windows if you use Adobe Type Manager, run the ATM Control Panel.

Q How do I put Kanji, Arabic, Chinese, and other non-European characters on my pages?

A First of all, everyone who you want to be able to read these characters on your pages must have the appropriate language fonts installed. They must also have selected that language character set and font under Options | General Preferences | Fonts in Netscape Navigator or View | Options | General | Fonts in Microsoft Internet Explorer. You can use the Character Map accessory in Windows 95 (or a similar program in other operating systems) to get the numerical codes for each character in any language font. If the character you want has a code of 214, use Ö to place it on a Web page.

The best way to include a short message in an Asian language (such as We speak Tamil--Call us!) is to include it as a graphics image. That way everyone will see it, even if they use English as their primary language for Web browsing.
Quiz Questions
1. How would you say, "We're having our annual Nixon Impeachment Day SALE today!" in normal-sized blue text, but with the word "SALE" at the largest possible size in bright red?

2. How would you make all text on a page green and a little larger than normal, but make all headings yellow?

3. How do you say "Š 1996, Webwonks Inc." on a Web page?
 
 
 
 
The God Father
Developer's Avatar

Reply With Quote
 
Join Date: Jul 2008
Location: NDC
Posts: 5,425
16-07-2008, 11:21 PM
 
Hour 7
Arranging Text in Lists
When you present information on paper (or with a good old-fashioned overhead projector) you probably often include lists of numbered steps or "bullet points." You've also undoubtedly written many indented lists to organize information such as terms and their definitions or the outline of a business plan. Because lists are so common, HTML provides tags which automatically indent text and add numbers or bullets in front of each listed item.

In this chapter, you'll find out how to format numbered lists, bulleted lists, and a variety of other indented lists. You will also see how the HTML tags for creating lists can be used for almost any other type of indentation you want on your Web pages. To Do: You can make the most of this chapter if you have some text that needs to be indented correctly to be presentable.

Any type of outline, "bullet points" from a presentation, numbered steps, glossary, or list of textual information from a database will serve as good material to work with.

If the text you'll be using is from a word processor or database program, be sure to save it to a new file in plain text or ASCII format. You can then add the appropriate HTML tags to format it as you go through this chapter.
The Three Types of HTML Lists
There are three basic types of HTML lists. All three are shown in Figure 7.2, and Figure 7.1 reveals the HTML to construct them:

The numbered list at the top is called an ordered list. It begins with the <OL> tag and ends with a closing </OL> tag. Numbers and line breaks appear automatically at each <LI> tag, and the entire list is indented.

The bulleted list is called an unordered list. It opens with the <UL> tag and closes with </UL>. It looks just like an ordered list, except that bullets appear at each <LI> tag instead of numbers.

The list of terms and their meanings is called a definition list. It starts with the <DL> tag and ends with </DL>. The <DT> tag goes in front of each term to be defined, with a <DD> tag in front of each definition. Line breaks and indentation appear automatically.

--------------------------------------------------------------------------------
New Term: Ordered lists are indented lists that have numbers or letters in front of each item.
--------------------------------------------------------------------------------



--------------------------------------------------------------------------------
New Term: Unordered lists are indented lists with a special bullet symbol in front of each item.
--------------------------------------------------------------------------------



--------------------------------------------------------------------------------
New Term: Definition lists are indented lists without any number or symbol in front of each item.
--------------------------------------------------------------------------------



--------------------------------------------------------------------------------
Just A Minute: Remember that different Web browsers can display Web pages quite differently. The HTML standard doesn't specify exactly how Web browsers should format lists, so people using older Web browsers may not see the same indentation that you see. Software of the future may also format HTML lists differently, though all current Web browsers now display lists in almost exactly the same way.
--------------------------------------------------------------------------------

Figure 7.1. Use <OL> and <LI> for ordered lists, <UL> and <LI> for unordered lists, and <DL>, <DT>, and <DD> for definition lists.

Figure 7.2. The three types of HTML lists, as they appear in Netscape Navigator.

Lists Within Lists
Although definition lists are officially supposed to be used for defining terms, many Web page authors use them anywhere they'd like to see some indentation. In practice, you can indent any text simply by putting <DL><DD> at the beginning of it and </DL> at the end.

You can indent items further by nesting one list inside another, like this:

<DL><DD>This item will be indented

<DL><DD>This will be indented further

<DL><DL><DD>And this will be indented very far indeed

</DL></DL></DL></DL>


Just make sure you always have the same number of closing </DL> tags as opening <DL> tags.

Ordered and unordered lists can also be nested inside one another, down to as many levels as you wish. In Figure 7.3, a complex indented outline is constructed from several unordered lists. You'll notice in Figure 7.4 that Netscape Navigator automatically uses a different type of bullet for each of the first three levels of indentation, making the list very easy to read.

Figure 7.3. You can build elaborate outlines by placing lists within lists.

As shown in Figure 7.4, Netscape Navigator will normally use a solid disc for the first-level bullet, a hollow circle for the second-level bullet, and a solid square for all deeper levels. However, you can explicitly choose which type of bullet to use for any level by using <UL TYPE="disc">, <UL TYPE="circle">, or <UL TYPE="square"> instead of <UL>.

You can even change the bullet for any single point in an unordered list by using the TYPE attribute in the <LI> tag. For example, the following would display a hollow circle in front of the words "Extra" and "Super," but a solid square in front of the word "Special."

<UL TYPE="circle">

<LI>Extra

<LI>Super

<LI TYPE="square">Special

</UL>


Figure 7.4. Multi-level unordered lists are neatly indented and bulleted for readability.



--------------------------------------------------------------------------------
Just A Minute: Netscape Navigator is the only Web browser that currently lets you control the appearance of list bullets. All bullets will appear as solid discs in Microsoft Internet Explorer 3.0.
--------------------------------------------------------------------------------

The TYPE attribute also works with ordered lists, but instead of choosing a type of bullet you choose the type of numbers or letters to place in front of each item. Figure 7.5 shows how to use roman numerals (TYPE="I"), capital letters (TYPE="A"), and lowercase letters (TYPE="a"), along with ordinary numbers in a multi-level list. In Figure 7.6, you can see the resulting nicely formatted outline.

Though Figure 7.5 uses only the TYPE attribute with the <OL> tag, you can also use it for specific <LI> tags within a list (though it's hard to imagine a situation where you would want to). You can also explicitly specify ordinary numbering with TYPE="1", and you can make lowercase roman numerals with TYPE="i".

Here's one more seldom-used but handy-when-you-need-it trick: You can start an ordered list with any number (or letter) with the START attribute. <OL START="3">, for example, starts a numbered list at 3 instead of 1. Individual points can be renumbered with the VALUE attribute (<LI VALUE="12">, for example).



--------------------------------------------------------------------------------
Just A Minute: Note that you must always use numbers with the START and VALUE attributes. To make a list that starts with the letter C, for example, you need to type <OL TYPE="A" START="3">.
--------------------------------------------------------------------------------

Figure 7.5. The TYPE attribute lets you make multi-tiered lists with both numbered and lettered points.


--------------------------------------------------------------------------------
Coffee Break: By combining ordered, unordered, and definition lists within one another, you can organize the most complex information in a readable and attrac-tive way. To get your creative juices flowing, I've created a "list of lists" for you to browse through before you begin organizing your own HTML lists.
--------------------------------------------------------------------------------

To check it out, go to the 24-Hour HTML Café List-O-Mania page at

http://www.mcp.com/sams/books/235-8/listlist.htm


Have some fun while you're there by trying to figure out what the real titles of the sample lists might be, based on the information they contain. Answers are given--as a nested HTML list, of course--at the end of the page.

You can also see how a list was used to enhance the 24-Hour HTML Café welcome page during the early stages of its development, at

http://www.mcp.com/sams/books/235-8/cafe7.htm


Figure 7.6. A well-formatted outline can make almost any plan look plausible.

To Do: Take a list or two of your own, and try to find the best way to present the information so that it can be easily understood.

Which type of list or combination of list types best suits your list? Use ordered lists only for lists that have a natural order to them. Try to avoid more than seven bullet points in a row in any unordered list, or the list will be hard to read. Use definition lists whenever indenting is sufficient to convey the structure of your information.

Start each list (or new level within a multi-tiered list) with an <OL>, <UL>, or <DL>. Start each point within the list with <LI>. Use the TYPE attribute if you want non-standard bullets or letters instead of numbers.

If you want a blank line between list items, put a <P> tag next to each <LI> tag.

Be very careful to close every <OL> list with </OL>, and to make sure that each <UL> or <DL> has a corresponding </UL> or </DL>. Unclosed lists can make pages look very strange, and can even cause some Web browsers not to display the list at all.
Summary
In this chapter, you learned to create and combine three basic types of HTML lists: ordered lists, unordered lists, and definition lists. Lists can be placed within other lists to create outlines and other complex arrangements of text.

Table 7.1 lists all the tags and attributes covered in this chapter.

Table 7.1. HTML tags and attributes covered in Chapter 7. Tag Attribute Function
<OL>...</OL> An ordered (numbered) list.
TYPE="..." The type of numerals used to label the list. Possible values are A, a, I, i, 1.
START="..." The value with which to start this list.
<UL>...</UL> An unordered (bulleted) list.
TYPE="..." The bullet dingbat used to mark list items. Possible values are DISC, CIRCLE, and SQUARE.
<LI> A list item for use with <OL> or <UL>.
TYPE="..." The type of bullet or number used to label this item. Possible values are DISC, CIRCLE, SQUARE, A, a, I, i, 1.
VALUE="..." The numeric value this list item should have (affects this item and all below it in <OL> lists).
<DL>...</DL> A definition list.
<DT> A definition term, as part of a definition list.
<DD> The corresponding definition to a definition term, as part of a definition list.


Q&A
Q I used <UL TYPE="square">, but the bullets still came out round, not square.

A Are you using Netscape Navigator version 2.0 or higher? Alternate bullet types don't show up in any other Web browser yet, but they probably will in future versions.

Q I've seen pages on the Internet that use three-dimensional looking little balls or other special graphics for bullets. How do they do that?

A That trick is a little bit beyond what this chapter covers. You'll find out how to do it yourself in Chapter 9, "Putting Images on a Web Page."
Quiz Questions
1. Write the HTML to create the following ordered list:
X. Xylophone

Y. Yak

Z. Zebra

2. How would you indent a single word and put a square bullet in front of it?

3. Use a definition list to show that the word "glunch" means "a look of disdain, anger, or displeasure" and the word "glumpy" means "sullen, morose, or sulky."

4. Write the HTML to create the following indentation effect:
Apple pie,

pudding,

and pancake,

All begin with an A.
 
 
 
 
The God Father
Developer's Avatar

Reply With Quote
 
Join Date: Jul 2008
Location: NDC
Posts: 5,425
16-07-2008, 11:22 PM
 
Hour 8
Intra-Page and E-mail Links
In Chapter 3, "Linking to Other Web Pages," you learned to use the <A> tag to create links between HTML pages. This chapter shows you how to use the same tag to allow readers to jump between different parts of a single page. This gives you a convenient way to put a table of contents at the top of a long document, or at the bottom of a page you can put a link that returns you to the top. You'll see how to link to a specific point within a separate page, too.

This chapter also tells you how to embed a live link to your e-mail address in a Web page, so readers can instantly compose and send a message to you from within most Web browsers.

Using Named Anchors
Figure 8.1 demonstrates the use of intra-page links. To see how such links are made, take a look the first <A> tag in Figure 8.1:

<A NAME="top"></A>


This is a different use of the <A> anchor tag; all it does is give a name to the specific point on the page where the tag occurs. The </A> tag must be included, but no text is necessary between <A> and </A>.

Now look at the last <A> tag in Figure 8.1:

<A HREF="#top">Return to top of document.</A>


The # symbol means that the word "top" refers to a named anchor point within the current document, rather than a separate page. So when a reader clicks on Return to top of document., the Web browser will display the part of the page starting with the <A NAME="top"> tag.

Figure 8.1. An <A> tag with a NAME attribute acts as a marker, so <A> tags with HREF attributes can link to that specific point on a page.

Here's an easy way to remember the difference between these two different types of <A> tags: <A HREF> is what you click on, and <A NAME> is where you go when you click there.


--------------------------------------------------------------------------------
New Term: An anchor is a named point on a Web page. The same tag is used to create hypertext links and anchors (which explains why the tag is named <A>).
--------------------------------------------------------------------------------

Similarly, each of the <A HREF> links in Figure 8.1 makes an underlined link leading to a corresponding <A NAME> anchor. Clicking on "II. Right to bear arms" in Figure 8.2, for instance, takes you to the part of the page shown in Figure 8.3.

Figure 8.2. The <A NAME> tags in Figure 8.1 don't appear at all on the Web page. The <A HREF> tags appear as underlined links.

Figure 8.3. Clicking on "II. Right to bear arms" in Figure 8.2 takes you down to "Amendment II" on the same page.

To Do: Now that you have several pages of your own linked together, you might want to add an index at the top of your home page so people can easily get an overview of what your pages have to offer.

Place <A NAME> tags in front of each major topic on your home page, or any long page you make.

Copy each of the major topic headings to a list at the top of the page, and enclose each heading in an <A HREF> linking to the corresponding <A NAME> tag.
Linking to a Specific Part of Another Page
You can even link to a named anchor on another page by including the address or name of that page followed by # and the anchor name.

Figure 8.4 shows several examples, such as this one:

<A HREF="articles.htm#two">II. The President</A>


Clicking on "II. The President" (in Figure 8.5) will bring up the page named articles.htm, and go directly to the point where <A NAME="two"> occurs on that page.

Figure 8.4. To link to a specific part of another page, put both the page address and anchor name in the <A HREF> tag.

Figure 8.5. The page listed in Figure 8.4. The first seven links all go to different parts of a page named articles.htm.



--------------------------------------------------------------------------------
Caution: Be sure to only include the # symbol in <A HREF> link tags. Don't put a # symbol in the <A NAME> tag, or links to that name won't work.
--------------------------------------------------------------------------------




--------------------------------------------------------------------------------
Coffee Break: One of the most common uses for the <A NAME> tag is creating an alphabetical index. The bad news for anyone with an alphabetical list that they want to index is that typing out 26 links to 26 anchors is a rather tedious endeavor. The good news is that I've already done it for you and dropped off the indexed page at the 24-Hour HTML Café:

http://www.mcp.com/sams/books/235-8/alpha.htm

You can just save this document to your hard drive, and then cut-and-paste your own alphabetical information after each letter. While you're at the Café, stop by

http://www.mcp.com/sams/books/235-8/cafe8.htm


to see how the progress on the "construction site" is going. This page uses <A HREF> tags to link all the sample pages discussed so far in the book and <A NAME> tags to provide an index at the top.


--------------------------------------------------------------------------------

Linking Your E-mail Address to a Web Page
In addition to linking between pages and between parts of a single page, the <A> tag allows you to link to your e-mail address. This is the simplest way to enable readers of your Web pages to "talk back" to you. Of course, you could just tell them your e-mail address and trust them to type it into whatever e-mail program they use if they want to say something to you. But you can make it almost completely effortless for them to send you a message by providing a clickable link to your e-mail address instead.

An HTML link to my e-mail address would look like this:

<A HREF="mailto:dicko@netletter.com">Send me an e-mail message.</A>


The words Send me an e-mail message. will appear just like any other <A> link (as underlined text in the color you set for links in the LINK or VLINK attributes of the <BODY> tag). In most Web browsers, when someone clicks on the link they get a window where they can type in a message, which will be immediately sent to you.

If you want people to see your actual e-mail address (so they can make note of it or send a message using a different e-mail program), type it both in the HREF attribute and as part of the message between the <A> and </A> tags.

For example, the HTML in Figure 8.6 is an e-mail directory page for my little "Mom and Pop software shop," Cedar Software. The resulting page in Figure 8.7 shows the principal officers with a clickable e-mail link for each.

When someone clicks on the top link in Figure 8.7 in Netscape Navigator 3.0, a separate window (see Figure 8.8) will open with spaces for him to enter a subject line and e-mail message. The e-mail address from the link will be automatically entered for him, and he can simply click on the mail button to send the message.



--------------------------------------------------------------------------------
Time Saver: It is customary to put an e-mail link to the Web page author at the bottom of every Web page. Not only does this make it easy for customers or others to contact you, it also gives them a way to tell you about any problems with the page that your testing may have missed.
--------------------------------------------------------------------------------

Figure 8.6. Links to e-mail addresses use the same <A> tag as links to Web pages.

Figure 8.7. The "mailto:" links in Figure 8.6 look just like http:// links on the page.

Figure 8.8. Clicking on the top link in Figure 8.7 brings up this e-mail window with-in Netscape Navigator.

Summary
This chapter has shown you two uses for the <A> tag not covered in Chapter 3. You saw how to create named anchor points within a page and how to create links to a specific anchor. You also saw how to link to your e-mail address so readers can easily send you messages.

Table 8.1 summarizes the two attributes of the <A> tag discussed in this chapter.

Table 8.1. HTML tags and attributes covered in Chapter 8. Tag Attribute Function
<A>...</A> With the HREF attribute, creates a link to another document or anchor; with the NAME attribute, creates an anchor that can be linked to.
HREF="..." The address of the document and/or anchor point to link to.
NAME="..." The name for this anchor point in the document.


Q&A
Q Can I put both HREF and NAME in the same <A> tag? Would I want to for any reason?

A You can, and it might save you some typing if you have a named anchor point and a link right next to each other. But it's generally better to use <A HREF> and <A NAME> separately to avoid confusion, because they play very different roles in an HTML document.

Q What happens if I accidentally spell the name of an anchor wrong, or forget to put the # in front of it?

A If you link to an anchor name that doesn't exist within a page (or you misspell the anchor name), the link just goes to the top of that page.

Q What if I use a different company to handle my e-mail than my Web pages? Will my e-mail links still work?

A Yes. You can put any e-mail address on the Internet into a link, and it will work fine. The only situation where e-mail links won't work is when the person who clicks on the link hasn't set up the e-mail part of their Web browser properly, or is using an older version that isn't capable of sending e-mail.
Quiz Questions
1. Write the HTML to make it possible for someone clicking on the words "About the authors" at the top of the page to skip down to a list of credits at the bottom of the page.

2. Suppose your company has three employees, and you want to create a company directory page listing some information about each of them. Write the HTML for that page, and the HTML to link to one of the employees from another page.

3. If your e-mail address is bon@soir.com, how would you make the text "goodnight greeting" into a link that people can click on to compose and send you an e-mail message?
Answers
 
 
 
Reply

Programming Languages Thread, HTML in 1 day in Programming , WebDesign & Development; Hour 1 Welcome to HTML Before you begin creating your own Web pages with HTML, you need some backgroundknowledge about ...

Short Link: http://forum.egypt.com/enforum/showthread.php?t=2150


Bookmarks

Tags
day, html


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
HTML Tables Developer Articles 0 28-10-2008 06:57 PM
HTML Attributes Developer Articles 0 28-10-2008 06:37 PM
Lesson : HTML Linking to E-Mail in HTML Tutorial Developer Articles 0 17-10-2008 09:14 PM
Html 4.01 Developer Articles 0 03-09-2008 10:26 PM
What is HTML? Developer Articles 0 03-09-2008 10:24 PM