Generally speaking, Web sites are made up of HTML documentsplain text documents that combine text and HTML tags or codes. Each HTML document makes up a Web page. A group of related (and usually linked) Web pages make up a Web site. In this part of the chapter, I explain the basics of building a Web site. This information is vital if you plan to build a Web site yourself and want to do it right the first time. It'll also be very helpful if you hire a Web designer and want to understand what he is doing. A Closer Look at HTMLI introduced HTML back in Chapter 1. If you plan on creating Web pages, it's time to take a closer look at it. HTML works by encoding plain text with HTML tags. By enclosing text within tags, you can specify how the text is to be formatted. You can also include path names or URLs within certain tags to display images or create links. Figure 8.1 shows a very small, very simple Web page that combines text, images, and links. Figure 8.2 shows the HTML code that made up that page. Kind of scary, isn't it? Figure 8.1. Here's an example of a very short, very simple Web page that includes formatted text, a graphic, and a link.
Figure 8.2. Here's the HTML underlying the above Web page.
Fortunately, as you'll learn later in this chapter, you don't have to enter all those codes manually to create a Web page. In fact, you don't even have to know HTML at allalthough a basic knowledge might be helpful for troubleshooting problems. Building Locally, Uploading RemotelyWhen you create a Web site, you build it on your computer, not on the Web server. This is referred to as the local copy of your site. Then, when you are ready to put your site online, you upload it to the Web server. The Web server has the remote copy of your site. You may already see a small problem with this. If you have two copies of your Web site, how do you know which one is the more recent copy? Well, if you're smart and organized, you'll only make changes to the copy on your computerthe local copy. Then it will always be the most up-to-date. Of course, Web site visitors don't see the local copy. They only see the remote copy. So each time you make a change to the local copy, you must put a fresh copy on the Web server, thus updating the remote copy so it matches the local copy. Here's a quick review of the process:
I'll tell you more about uploading files to a Web server in Chapter 10. Organizing FilesWhen you create the local copy of your Web site, it's important to properly organize the files that will make up the site. This way, when you copy the local files to the Web server, the files will retain their relationships to one another. This assures that all links will function correctly and all images will appear as they should. Here's a step-by-step approach to organizing your Web site's files on your hard disk. Step 1: Create & Name the Local Root FolderBegin by creating a folder in which to store the local copy of your Web site on your hard disk. This folder is called the local root folder because it will be at the root directory of your Web site. You can name this folder anything you like, but I usually give it the same name as the folder in which the remote copy of the Web site will reside. For example, my local copy of the files for wickenburg-az.com is named wickenburg because that's the same name as the site's folder on the Web server. Step 2: Create & Name Resource FoldersResources are Web site files other than HTML documents. Resources include images, downloadable files, PDF format files, Java class files (if Java is used), and any other type of file that is used within an HTML document. If your site will have only a few resources, one folder should do the job. Name it anything you like resources isn't a bad name. If your site is likely to have lots of different types of resources, you might want to create a folder for each type. For example, wickenburg-az.com's site includes graphic images, photographs, and PDF format files. To best organize all of these files, I created folders called images , photos , and pdfs . On the other hand, if your site will be so tiny that it's likely to include only a handful of files, including resources, you can skip this step. Step 3: Create & Name Subfolders (Optional)If your Web site will be very large, with a logical, hierarchical organization, you may want to create additional folders within the root folder in which to store groups of related Web pages. There are two benefits to doing this:
If each group of Web pages has its own collection of resources, you might consider creating resources folders within each subfolder. This can further aid your organization efforts if there are many files. File Naming ConventionsBefore you begin creating and saving Web pages, you should check with your ISP for any special file naming conventions. File name requirements are determined by the Web server, not the computer on which you create the files. Specifically, ask these three questions:
One thing I can tell you so you don't have to ask is that filenames cannot include spaces. If you don't get the answers to these questions before you start creating pages and you name them incorrectly, you'll have to rename pages and recreate links. Trust me, this is not something you want to do. Creating PagesWhen you're ready to begin creating Web pages for your site, fire up your Web authoring software of choice and hop to it. Unfortunately, I can't provide detailed instructions for creating Web pages, because the task varies depending on the Web authoring software you use. If you're brand new to building Web sites, I recommend that you work through any tutorial that may have come with your Web authoring software. If there isn't a tutorial, use the manual that came with the software to create simple pages. You can always get fancy later, once you have a good handle on how the software works. If there isn't a manual, get a how-to guide; there's a good chance it'll be better than any manual anyway. Tip I tell you about Web authoring software and some how-to guides to get the most of it later in this chapter. Adding Resources & LinksAdding resources (such as images) and links to pages can be tricky. If you're going to have problems, this is probably where they'll occur. Here are a few things to remember if you want to prevent resource and link-related problems.
Testing PagesAn important (and overlooked) part of building a Web site is testing the completed Web pages. This means opening them up with a Web browser-or better yet, multiple Web browsersto make sure they appear and work the way they should. If something isn't right, use your Web authoring software to fix it (if you can) and test it again. Using the preview feature of your Web authoring software to test a Web page is usually not enough. Only by looking at a page in a Web browser window can you be certain how it will look in that Web browser. Tip If possible, try testing each Web page with a variety of Web browsersincluding old browserson a variety of computer systems and screen sizes. You may be surprised how different the same page can appear when viewed with different software or computer systems (see Figure 8.4). Figure 8.4. These two pages show the same page viewed with a variety of browsers, screen sizes, and computer platforms. Although the page doesn't look the same in every shot, it doesn't "break"look terrible or illegible in any of these combinations. This page: Top: Mac OS, Netscape Navigator 2.0, 640 x 480 screen. This version does not support style sheets, so the default font is used. Middle: Mac OS, Netscape Communicator 4.7, 640 x 480 screen. Bottom: Mac OS, Netscape Communicator, 600 x 800 screen.
Figure 8.4. This page: Top: Windows 95, Microsoft Internet Explorer, 640 x 480 screen. Middle: Windows 95, Microsoft Internet Explorer, 600 x 800 screen. Bottom: Windows 95, Netscape Navigator 4.0, 600 x 800 screen.
The testing process must be repeated every time you make a change to a Web page. If you think that could get tedious , you're very astute. But testing is the only way to assure that the page is just right. |