Earnings in the Internet permanently and regularly pay
Web Authoring FAQIndex
1. Getting Started1.2. Where can I find a list of all the current HTML tags?The current W3C Recommendation is HTML 4.0. HTML 4.0 extends HTML 3.2 to include support for frames, internationalization, style sheets, advanced tables, and more. HTML 4.0 is not well supported by current browsers, but many of its features can be used safely in non-supporting browsers. Recommended materials on HTML 4.0:
Recommended materials on HTML 3.2:
Some materials on browser-specific versions of HTML:
1.3. How do I get a so-and-so character in my HTML?The safest way to do HTML is in (7-bit) US-ASCII, and expressing characters from the upper half of the 8-bit code by using HTML entities. See the answer to "Which should I use, &entityname; or &#number; ?" Working with 8-bit characters can also be successful in many practical situations: Unix and MS-Windows (using Latin-1), and also Macs (with some reservations). The available characters are those in ISO-8859-1, listed at <URL:HTMLHelp>. On the Web, these are the only characters widely supported. In particular, characters 128 through 159 as used in MS-Windows are not part of the ISO-8859-1 code set and will not be displayed as Windows users expect. This includes the em dash, en dash, curly quotes, bullet, and TM symbol; neither the actual character nor &#nnn; is correct. (See the last paragraph of this answer for more about those characters.) On platforms whose own character code isn't ISO-8859-1, such as MS DOS, Macs, there may be problems: you'd have to use text transfer methods that convert between the platform's own code and ISO-8859-1 (e.g Fetch for the Mac), or convert separately (e.g GNU recode). Using 7-bit ASCII with entities avoids those problems, and this FAQ is too small to cover other possibilities in detail. Mac users - see the notes at the above URL. If you run a web server (httpd) on a platform whose own character code isn't ISO-8859-1, such as a Mac, or IBM mainframe, it's the job of the server to convert text documents into ISO-8859-1 code when sending them to the network. If you want to use characters outside of the ISO-8859-1 repertoire, you must use HTML 4.0 rather than HTML 3.2. See the HTML 4.0 Recommendation at <URL:W3> and the Babel site at <URL:Babel> for more details. Another useful resource for internationalization issues is at <URL:flavell>. 1.4. Should I put quotes around attribute values?It depends. It is never wrong to use them, but you don't have to if the attribute value consists only of letters (A-Za-z), digits, periods and hyphens. This is explained in the HTML 2.0 specs. Be careful when your attribute value includes double quotes, for instance when you want ALT text like "the "King of Comedy" takes a bow" for an image. Humans can parse that to know where the quoted material ends, but browsers can't. You have to code the attribute value specially so that the first interior quote doesn't terminate the value prematurely. There are two main techniques:
Both these methods are correct according to the spec and are supported by current browsers, but both were poorly supported in some earlier browsers. The only truly safe advice is to rewrite the text so that the attribute value need not contain quotes, or to change the interior double quotes to single quotes, like this: ALT="the 'King of Comedy' takes a bow". 1.5. How can I include comments in HTML?A comment declaration starts with "
But some browsers do not support the full syntax, so we recommend you follow this simple rule to compose valid and accepted comments:
See <URL:HTML Help> for a more complete discussion. 1.6. How can I check for errors?The easiest way to catch errors in your HTML is through the use of a program called a validator. A validator is a program which knows all the rules in HTML, reads your source document and outputs a list of mistakes. While checking for errors in the HTML, it is also a good idea to check for hypertext links which are no longer valid. There are several link checkers available for various platforms which will follow all links on a site and return a list of the ones which are non-functioning. You can find a list of validators and link checkers at <URL:HTML Help>. Especially recommended is the use of an SGML-based validator such as the WDG HTML Validator <URL:HTML Help> or W3C HTML Validation Service <URL:w3.org>. 1.7. What is a DOCTYPE? Which one do I use?According to HTML standards, each HTML document begins with a DOCTYPE declaration that specifies which version of HTML the document uses. The DOCTYPE declaration is useful primarily to SGML-based tools like HTML validators, which must know which version of HTML to use in checking the document's syntax. Browsers generally ignore DOCTYPE declarations. See <URL:HTML Help> for information on choosing an appropriate DOCTYPE declaration. 2. Web Publishing2.1. Where can I put my newly created Web pages?Many ISPs offer web space to their dial-up customers. Typically this will be less than 5MB, and there may be other restrictions; for example, many do not allow commercial use of this space. There are several companies and individuals who offer free web space. This usually ranges from 100KB up to 1MB, and again there are often limitations on its use. They may also require a link to their home page from your pages. The following page has pointers to several lists of free web space providers: <URL:Yahoo Free Pages>. There are also many web space providers (aka presence providers) who will sell you space on their servers. Prices will range from as little as $1 per month, up to $100 per month or more, depending upon your needs. Non-virtual Web space is typically the cheapest, offering a URL like: http://www.some-provider.com/yourname/ For a little more, plus the cost of registering a domain name, you can get virtual web space, which will allow you to have a URL like http://www.yourname.com/. If you have some permanent connection to the Internet, perhaps via leased line from your ISP then you could install an httpd and operate your own Web server. There are several Web servers available for almost all platforms. If you just wish to share information with other local users, or people on a LAN or WAN, you could just place your HTML files on the LAN for everyone to access, or alternatively if your LAN supports TCP/IP then install a Web server on your computer. 2.2. Where can I announce my site?
2.3. Is there a way to get indexed better by the search engines?Yes. Use a meaningful
Both may contain up to 1022 characters, but no markup other than entities.
If you use a keyword too often in the
Search Engine Watch at <URL:http://searchenginewatch.com/> is a Web site dedicated to search engines and strategies for Web page authors. 2.4. How do I prevent my site from being indexed by search engines?See <URL:WebCrawler>. 2.5. How do I redirect someone to my new page?The most reliable way is to configure the server to send out a redirection instruction when the old URL is requested. Then the browser will automatically get the new URL. This is the fastest and most efficient way, and is the only way described here that can convince indexing robots to phase out the old URL. For configuration details consult your server admin or documentation (with NCSA or Apache servers, use a Redirect statement in .htaccess). If you can't set up a redirect, there are other possibilities. These are inferior because they tell the search engines that there's still a page at the old location, not that the page has moved to a new location. But if it's impossible for you to configure redirection at your server, here are two alternatives:
2.6. How do I password protect my web site?Password protection is done through HTTP authentication. The configuration details vary from server to server, so you should read the authentication section of your server documentation. Contact your server administrator if you need help with this. For example, if your server is Apache, see <URL:Apache>. 2.7. How do I hide my source?You can't. The source is necessary for the browser to display your document. You have to send the complete, unencrypted source to the browser. Even if a particular browser doesn't have a "View source" option, there are many that do, and you can always retrieve the document by hand (using telnet) to get its source. Or check the browser's cache. You can of course put a hundred empty lines above the actual source. Then newbies who don't see the scrollbars will think there is nothing there. 2.8. How do I detect what browser is being used?Many browsers identify themselves when they request a document. A CGI script will have this information available in the HTTP_USER_AGENT environment variable, and it can use that to send out a version of the document which is optimized for that browser. Keep in mind not all browsers identify themselves correctly. Microsoft Internet Explorer, for example, claims to be "Mozilla" to get at Netscape enhanced documents. And of course, if a cache proxy keeps the Netscape enhanced document, someone with another browser will also get this document if he goes through the cache. For these reasons and others, it is not a good idea to play the browser guessing game. 2.9. How do I get my visitors' email addresses?You can't. Although each request for a document is usually logged with the name or address of the remote host, the actual username is almost never logged as well. This is mostly because of performance reasons, as it would require that the server uses the ident protocol to see who is on the other end. This takes time. And if a cache proxy is doing the request, you don't get anything sensible. But just stop to think for a minute... would you really want every single site you visit to know your email address? Imagine the loads of automated thank you's you would be receiving. If you visited 20 sites, you would get at least 20 emails that day, plus no doubt they would send you invitations to return later. It would be a nightmare as well as an invasion of privacy! In Netscape 2.0, it was possible to automatically submit a form with a mailto as action, using JavaScript. This would send email to the document's owner, with the address the visitor configured in the From line. Of course, that can be "mickey.mouse@disney.com". This was fixed by Netscape 2.01. The most reliable way is to put up a form, asking the visitor to fill in his email address. To increase the chances that visitors will actually do it, offer them something useful in return. 3. Web Design3.1. How do I include one file in another?HTML itself offers no way to seamlessly incorporate the content of one file into another. True dynamic inclusion of one HTML document (even in a different "charset") into another is offered by the OBJECT element, but due to shortcomings of browser versions in current use, it seems unwise to rely on this yet for essential content. The same can be said for IFRAME. Two popular ways of including the contents of one file seamlessly into another for the WWW are preprocessing and server-side inclusion. Preprocessing techniques include the C-preprocessor and other generic text manipulation methods, and several HTML-specific processors. But beware of making your "source code" non-portable. The HTML can only be validated after pre-processing, so the typical cycle "Edit, Check, Upload" becomes "Edit, Preprocess, Check, Upload" (here, "Check" includes whatever steps you use to preview your pages: validation, linting, management walk-through etc.; and "upload" means whatever you do to finally publish your new pages to the web server). A much more powerful and versatile pre-processing technique is to use an SGML processor (such as the SP package) to generate your HTML; this can be self-validating. Examples of server-side inclusion are Server Side Includes "SSI" (Apache, NCSA and some other web servers) and "ASP"; processing occurs at the time the documents are actually retrieved. A typical inclusion looks like
but be sure to consult your own server's documentation, as the details vary somewhat between implementations. The whole directive gets replaced by the contents of the specified file. Using server-side inclusion (a potentially powerful tool) merely as a way to insert static files such as standard header/footers has implications for perceived access speed and for server load, and is better avoided on heavily loaded servers. If you use it in this way, consider making the result cacheable (e.g., via "XBitHack full" on Apache; setting properties of the "Response" object in ASP). Details are beyond the scope of this FAQ but you may find this useful: http://www.pobox.com/~mnot/cache_docs/ Proper HTML validation of server-side inclusion is only possible after server-side processing is done, e.g. by using an on-line validator that retrieves the document from the server. 3.2. Which should I use, &entityname; or &#number; ?In HTML, characters can be represented in three ways:
In theory these representations are equally valid. In practice, authoring convenience and limited support by browsers complicate the issue. HTTP being a guaranteed "8-bit clean" protocol, you can safely send out 8-bit or multibyte coded characters, in the various codings that are supported by browsers. A. HTML 2.0/3.2 (Latin-1)By now there seems no convincing reason to choose &entityname; versus &#number;, so use whichever is convenient. If you can confidently handle 8-bit-coded characters this is fine too, probably preferred for writing heavily-accented languages. Take care if authoring on non-ISO-8859-based platforms such as Mac, Psion, IBM mainframes etc., that your upload technique delivers a correctly coded document to the server. Using &-representations avoids such problems. B. A single repertoire other than Latin-1In such codings as ISO-8859-7 Greek, koi8-r Russian Cyrillic, and Chinese, Japanese and Korean (CJK) codings, use of coded characters is the most widely supported and used technique. Although not covered by HTML 3.2, browsers have supported this quite widely for some time now; it is a valid option within the HTML 4.0 specification--use a validator such as the WDG HTML Validator at /tools/validator/ which supports HTML 4.0 and understands different character encodings. Browser support for coded characters may depend on configuration and font resources. In some cases, additional programs called "helpers" or "add-ins" supply virtual fonts to browsers. "Add-in" programs have in the past been used to support numeric references to 15-bit or 16-bit code protocols such as Chinese Big5 or Chinese GB2312. In theory you should be able to include not only coded characters but also Unicode numeric character references, but browser support is generally poor. Numeric references to the "charset-specified" encoding may appear to produce the desired characters on some browsers, but this is wrong behavior and should not be used. Character entities are also problematical, aside from the HTML-significant characters <, & etc. C. Internationalization per HTML 4.0Recent versions of the popular browsers have support for some of these features, but at time of writing it seems unwise to rely on this when authoring for a general audience. If you'd like to explore the options, you can find comprehensive background documentation and some practical suggestions at
3.3. Should I use lower case or upper case for tags?Tags are case insensitive, so it doesn't matter. This is just a matter of style. (You may have noticed that this FAQ is not absolutely consistent in capitalization.) Many people prefer upper case, as it makes the tags "stand out" better amongst the text. Attribute names can also be upper or lower case, as you prefer. But
some attribute values are case sensitive. For example,
Entity names like 3.4. For what screen size should I write?HTML does not depend on screen size. Normally, the text will be wrapped by the browser when the end of its display area is encountered. (Note that graphical browsers are often used with windows that are smaller than the full area of the screen.) Preformatted lines (text within 6.10. How do I do a page break?Page breaks are offered in Cascading Style Sheets, Level 2, but they are not well supported by browsers. See <URL:w3.org> for information on CSS2 page breaks. In general, page breaks are not appropriate on the Web since what makes a nice page break for you with your font and font size may be a poor page break for me with my font and font size. If you need to produce a nicely formatted printed copy of your HTML documents, you might also consider using special purpose tools rather than your browser's Print function. For example, html2ps generates nicely formatted PostScript output from HTML documents, and HTML Scissor uses special HTML comments for suggesting page breaks. 6.11. How do I have a fixed background image?Use a style sheet with the following ruleset:
Note that while Internet Explorer 3+ respects the fixed property, Netscape does not. 6.12. How do I have a non-tiled background image?Use a style sheet with the following ruleset:
7. HTML Forms7.1. How do I use forms?Information relating to the use of forms is available at <URL:jkorpela>. 7.2. Why won't my form email the user's data to me? Forms that use The only reliable solution is to use a CGI (or other server-side) program to process your forms and mail the results to you. If you can run CGI programs on your server, see the list of prewritten scripts at <URL:CGI Resources>. If you can't run CGI programs on your own server, see the list of remotely hosted form-to-email services at <URL:CGI Resources>. 7.3. How do I make a form so it can be submitted by hitting ENTER?The short answer is that the form should just have one
7.4. How can I make a form with custom buttons? Rather than a normal submit button ( Most browsers will also send the x and y coordinates of the location where the user clicked on the image to the server. They are available as "foo.x=000&foo.y=000" in the CGI input. 7.5. Can I have two or more Submit buttons in the same form?Sure. This is part of HTML 2.0 Forms support (some early browsers did not support it, but browser coverage is now excellent). You will need to give your Submit buttons a Name attribute, and, optionally, a Value attribute. In order to determine which button was used, you will want to use distinctive Names, or Values, or both. Browsers will display the Value, in addition to sending it to the server, so choose something that's meaningful to the user. Example:
If you're unsure what results you're going to get when you submit your form, NCSA has a standard script which you can use. Code this, for example (assuming method "post"):
and then go through the motions of submitting your form. The NCSA server decodes the form input, and displays the result to you. 7.6. How can I allow file uploads to my web site?First of all, the RFC for this is located at <URL:ics>. File upload is handled by the CGI.pm Perl5 library available from <URL:cshl>. These things are necessary for Web-based uploads:
Not all browsers support form-based file upload, so try to give alternatives where possible. 8. HTML Frames8.1. How do I update two frames at once? There are two basic techniques for updating multiple frames with a
single link:
The HTML-based technique links to a new frameset document that specifies
the new combination of frames.
The JavaScript-based solution uses the The HTML-based technique can link to a new frameset document with
A link can now use The JavaScript-based solution uses the
The link will update 8.2. How do I get out of a frameset? If you are the author, this is easy. You only have to add the
It is in current implementations not possible to display a frame in the full browser window, at least not very easily. You would have to read source to determine the URL of the current frame, and then request that URL manually. I would recommend that authors who want to offer readers this option
add a link to the document itself in the document, with the
8.3. Is there a way to prevent getting framed? "Getting framed" refers to the technique of using an existing frameset
to display someone else's document against his wishes into the current
display.
This can happen quite easily if one of the documents in the frames uses a
link that does not use the To avoid "framing" other people's documents, you must add
Unfortunately, there is no way to specify that a particular document
should be displayed in the full browser window, rather than in the current
frame.
The only workaround is to configure the server to send out
The HTML specifications say that Another attempt is to use If the reader's browser has JavaScript enabled, the following script will automatically remove any existing framesets:
An alternative is
8.4. How do I specify a specific combination of frames instead of the default document?This is unfortunately not possible. When you navigate through a site using frames, the URL will not change as the documents in the individual frames change. This means that there is no way to indicate the combination of documents that make up the current view. The author can provide and link to multiple frameset documents, one for each combination of frame content. These frameset documents can be generated automatically, possibly even being created on the fly by a CGI program. 8.5. Why do my links open new windows instead of updating an existing window?If you use a name that does not point to a currently available frame, then a new browser window will be opened, and this window will be assigned the name you used. In HTML 4.0, the 8.6. How do I remove the border around frames?Removing the border around frames involves both not drawing the frame borders and eliminating the space between the frames. The two major frames-capable browsers use different proprietary attributes to achieve this. Netscape 3.0 only recognizes the Microsoft Internet Explorer recognizes the So, the most widely supported way to display borderless frames is
Note that these attributes are proprietary and not part of the HTML 4.0 specification. Also, removing the border around a frame makes it impossible to resize it, as this border is also used in most GUIs to change the size of the window. 8.7. How do I change the title of a framed document? The title displayed is the title of the frameset document - the HTML
document containing the 8.8. How do I make sure my framed documents are displayed inside their frameset?When the sub-documents of a frameset state are accessed directly, they appear without the context of the surrounding frameset. If the reader's browser has JavaScript support enabled, the following script will restore the frameset:
A more universal approach is a "restore frames" link:
Note that in either case, you must have a separate frameset document for every content document. If you link to the default frameset document, then your reader will get the default content document, rather than the content document he/she was trying to access. These frameset documents should be generated automatically, to avoid the tedium and inaccuracy of creating them by hand. Note that you can work around the problem with bookmarking frames by
linking to these separate frameset documents using
8.9. Are there any problems with using frames?The fundamental problem with the design of frames is that framesets create states in the browser that are not addressable. Once any of the frames within a frameset changes from its default content, there is no longer a way to address the current state of the frameset. It is difficult to bookmark - and impossible to link or index - such a frameset state. It is impossible to reference such a frameset state in other media. When the sub-documents of such a frameset state are accessed directly, they appear without the context of the surrounding frameset. Basic browser functions (e.g., printing, moving forwards/backwards in the browser's history) behave differently with framesets. Furthermore, frames focus on layout rather than on information structure,
and many authors of framed sites neglect to provide useful alternative
content in the For further discussion, see <URL:HTML Help> 8.10. Why aren't my frames the exact size I specified?Netscape Navigator seems to round pixel-based frame dimensions to the nearest whole percentage, and to use those percentage-based dimensions when laying out the frames. Thus, frames with pixel-based dimensions will be rendered with a slightly different size than that specified in the frameset document. There is no way to prevent this behavior. To accomodate this, you should design your site to accomodate variations in the browser's presentation. This is a good idea in general, but especially so in this situation. For additions or omissions to this FAQ, please contact <darin@htmlhelp.com>. All information contained herein was originally compiled by members of the Web Design Group, principally Arnoud "Galactus" Engelfriet and John Pozadzides. Additional input has been provided by Lori Atwater, Alex Bell, Stan Brown, Roger Carbol, Alex Chapman, Alan Flavell, Tina Marie Holmboe, Nick Kew, Jukka Korpela, Simon Lee, Neal McBurnett, Glen McDonald, Darin McGrew, Ken O'Brien, Timothy Prodin, Steve Pugh, , Kai Schätzl, Warren Steel, Peter Thomson, and Daniel Tobias. Thanks everyone! |