Paul McFedries' Web Home


The cover of The Complete Idiot's Guide to Create a Web Page The CIGHTML Mailing List
Frequently Asked Questions - General HTML

Main FAQ page

How can I let surfers download a file from my site?

In most cases, you set up a regular link and point it to the file you want to be able to download. For example, suppose you have a file named mystuff.zip. To set up a download link, you'd use the following:

<A HREF="mystuff.zip">Download my stuff<A>

This assumes that you've uploaded mystuff.zip to your server and that the file is in the same directory as your HTML file. When the user clicks the link, the browser will display a dialog box asking them whether they want to open the file or save it to their hard disk.

For files that get displayed in the browser (such as text files), you need to add instructions on your page that tell the user to load the file and then select their browser's File, Save As command.

How do I use a custom bullet in a bulleted list?

The solution I use is a two-column table, like so:

<TABLE>

<TR VALIGN="TOP">
<TD><IMG SRC="yourbullet.gif"></TD>
<TD>Bullet point 1 text goes here...</TD>
</TR>

<TR VALIGN="TOP">
<TD><IMG SRC="yourbullet.gif"></TD>
<TD>Bullet point 2 text goes here...</TD>
</TR>

etc.

</TABLE>

The browser shows the tags I put into the page. What's wrong?

This kind of problem is almost always caused by one of the following:

  1. The file isn't a pure text file but is, rather, in the format of a word processor. If you're using a word processor to create your HTML files, make sure that when you save the file, you choose the "Text Only" option in the Save As dialog box. (For those files you've already saved, use the "Save As" command to re-save the files as pure text.)
  2. The file doesn't have an "htm" or "html" extension. If you're using Windows 95 or 98 and saving a file as text, Windows has a perverse tendency to always want to add the "txt" extension onto the end of the file name. Even if you specify the "htm" extension when you save the file, Windows just adds the "txt" extension anyway (so you end up with something like "index.htm.txt").
Assuming the latter is the problem, the solution is to tell Windows to display file extensions. That way, the system will always honor the extensions you enter by hand and won't force documents saved as text to always use the "txt" extension. Here's how you do it:
  1. Launch Windows Explorer.
  2. Pull down the View menu and select the Options command (or the Folder Options command, depending on which version of Windows you're using).
  3. In the Options dialog box (you may need to select the View tab, again depending on which flavor of Windows you have), deactivate the "Hide MS-DOS extensions for the file types that are registered" check box.
  4. Click OK.
Once that's done, you'll be able to add the "htm" or "html" extension to the end of your file names. Note, too, that you should check your existing HTML files to see if they have a "txt" extension. For example, you may have files named "index.htm.txt", or whatever. If so, edit the file name to remove the ".txt" at the end.

How can I spell check my Web page?

You have two choices for getting your spelling letter-perfect:

  • Compose your pages in a program that has a spell check feature. You can find such a feature in word processors (such as Word), HTML editors (such as Netscape Composer), or in text editors (such as UltraEdit (http://www.ultraedit.com/).
  • Use a spell check program such as Spell Checker for Edit Boxes (http://www.quinion.com/mqa/index.htm).

Is there a way to make table columns have a constant width?

Absolutely! Provided you're only putting text in each cell, then you have to do two things:

  1. Specify an exact width for each cell.
  2. Use our old friend spacer.gif, the transparent 1x1 pixel image.
For example, if you want you a column to always be 100 pixels wide, use this:
<TD WIDTH="100">
Cell text goes here
<BR><IMG SRC="spacer.gif" WIDTH="100" HEIGHT="1">
</TD>
If you don't have spacer.gif, you can get it here:

http://www.mcfedries.com/graphics/spacer.gif

Select your browser's File, Save As command to save the file to your hard disk.

How do I change the color of a table's border?

Add the BORDERCOLOR attribute to the <TABLE> tag:

<TABLE BORDERCOLOR="#rrggbb">

Replace rrggbb with the six-digit code that represents the color you want.

The <MARQUEE> tag only works in Internet Explorer. Is there a way to get the same effect in other browsers?

You have a couple of choices here:

  • Use a Java applet. (See javasite.htm for some links to Java sites.)
  • GIF Construction Set has a feature that lets you create a marquee-like effect using an animated GIF.

Internet Explorer handles my link/graphic/whatever no problem, but Netscape doesn't. What's wrong?

The usual culprit here is that you've included a space in either a file name or a directory name. Netscape doesn't like spaces, so you need to rename your file or directory to remove the space. If you want to separate words in a file or directory name, a good substitute is the underscore character (_).

What is ASP?

If you come across a page file name that uses the .asp extension, then you've come across a species of page known as an Active Server Page (ASP, for short). Most ASP files contain one or more scripts that are very similar to the JavaScripts that you learned about in Part 4. However, there's one huge difference:

  • JavaScripts run when the browser loads the page or when the user initiates some action (such as submitting a form). In other words, JavaScripts are executed by the browser.

  • An ASP script is executed by the server. That is, when the user requests an ASP file, the server first checks to see if it contains a script. If it does, it runs that script and then sends the file to the user's browser.
The big advantage you get with ASP is that you no longer have to worry about browser compatibility, as you do with JavaScript. Since the script runs on the server, it doesn't matter what browser the user is running. Also, since the script runs on the server, it's fairly easy to do things like access a database, send an e-mail, and do other fancy tricks.

ASP is a Microsoft technology, so it's designed to run on Microsoft Web servers, such as Internet Information Server. If you want to give ASP a whirl, you have to find a Web host that supports it.

Instead of displaying the symbol represented by a character code or entity, I want to display the actual character code or entity. Is that possible?

Yes. All character codes and entities begin with an ampersand (&). So the easiest way to display the code is to remove the ampersand and replace it with the character code for the ampersand (&#38;). For example, the character code for the copyright symbol (©) is &#169;. To display the code, you'd use the following:

&#38;#169;

What's the difference between the .htm and .html file extensions?

There's no difference whatsoever. Both are legit HTML file extensions, and browsers process them equally. Note, however, that these extensions create separate files. For example, the files index.htm and index.html are distinct files.

What is XML?

XML (eXtensible Markup Language) is still pretty high-falutin' stuff, and it's not really on the radar screens just yet (and least not for the likes of us). The basic idea is that XML enables the designer to create their own tags in such a way that an XML-smart browser will know what to do with those tags. This won't be a big deal for folks who just have straightforward pages. If you deal with databases or specialized fields (such as medicine or mathematics), however, you can create tags that describe database components or elements from your field of expertise. For example, there's already a Math XML being proposed, and it'll enable math types to render equations and other elements that HTML just can't do:

http://www.w3.org/Math/

The problem with XML is that it requires some heavy-duty programming in order to "teach" the browser what each hand-built tag is supposed to do. For that reason, XML will remain a geeks-only technology for some time to come.

Finding non-geek info on XML is hard right now, but the following PC Magazine article isn't too bad:

http://www.zdnet.com/pcmag/features/xml98/intro.html

Is there any way to specify a Subject line with a mailto link?

Most (but not all) borwsers and e-mail programs let you specify the Subject line by adjusting the <A> tag as follows:

<A HREF="mailto:biff@isp.com?Subject=My Subject Line">

Replace My Subject Line with the Subject line you want.

How can I open a link in a separate browser window?

The usual method is to set the <A> tag's TARGET attribute equal to _blank:

<A HREF="whatever.html TARGET="_blank">New Window</A>

However, if you set the <A> tag's TARGET attribute equal to an undefined name—that is, it's not the name of a frame or one of the pre-fab names—then the browser will open a new window and assign the TARGET value as the name of the new window.

For example, consider the following:

<A HREF="whatever.html" TARGET="LinkWindow">Click this!</A>

This opens a new window and displays the "whatever.html" page within that window. The browser assigns the name "LinkWindow" to that window. This means that you can load anything into that window just by referring to the same window name, like so:

<A HREF="another.html" TARGET="LinkWindow">Click this, too!</A>

This link displays the "another.html" page in the same window that the previous link opened

Main FAQ page


Copyright © 1995-2008 Paul McFedries and Logophilia Limited