allanswers.org - comp.infosystems.www.authoring.html Web Authoring FAQ

 Home >  Internetwww >

comp.infosystems.www.authoring.html Web Authoring FAQ

Section 1 of 5 - Prev - Next
All sections - 1 - 2 - 3 - 4 - 5


    Web Authoring FAQ

    This document answers questions asked frequently by web authors. While
    its focus is on HTML-related questions, this FAQ also answers some
    questions related to CSS, HTTP, JavaScript, server configuration, etc.

    This document is maintained by Darin McGrew  of
    the Web Design Group, and is posted regularly to the newsgroup
    comp.infosystems.www.authoring.html. It was last updated on October
    20, 2001.

Index

 1. Preamble
     1. Copyright and Disclaimer
     2. Where is the latest version of this document?
     3. How can I contribute to this document?
     4. Can I email the author my questions?
     5. Credits
 2. Other Documents
     1. Where can I learn about the WWW?
     2. Where can I learn about HTML?
     3. Where can I find a list of all the current HTML tags?
     4. Where can I learn about CSS?
     5. Where can I learn about SGML?
     6. Where can I learn about XML (XSL)?
     7. Where can I learn about XHTML?
     8. Where can I learn about SSI ("SHTML")?
     9. Where can I learn about CGI?
    10. Where can I learn about JavaScript (LiveScript, JScript,
        EMCAScript, DOM)?
 3. Getting Started
     1. What is everyone using to write HTML?
     2. How can I show HTML examples without them being interpreted as
        part of my document?
     3. How do I get special characters in my HTML?
     4. Should I put quotes around attribute values?
     5. How can I include comments in HTML?
     6. How can I avoid using the whole URL?
     7. Should I end my URLs with a slash?
     8. How can I check for errors?
     9. What is a DOCTYPE? Which one do I use?
 4. Web Publishing
     1. Where can I put my newly created Web pages?
     2. How can I get my own domain name?
     3. How can I block my hosting service's advertisements?
     4. Where can I announce my site?
     5. Is there a way to get indexed better by the search engines?
     6. How do I prevent my site from being indexed by search engines?
     7. How do I redirect someone to another page?
     8. How do I password protect my web site?
     9. How do I stop my page from being cached?
    10. How do I hide my source?
    11. How do I hide my URL?
    12. How do I detect what browser is being used?
    13. How do I get my visitors' email addresses?
    14. Why is my custom 404 message not displayed?
 5. Web Design
     1. How do I include one file in another?
     2. How do I run a program on my web page?
     3. Which should I use, &entityname; or &#number; ?
     4. Should I use lower case or upper case for tags?
     5. For what screen size should I write?
     6. Why does my page display fine in one browser but incorrectly
        or not at all in another?
     7. Why does the browser show my plain HTML source?
     8. How do I freeze the URL displayed in a visitor's browser?
     9. How do I put links along the left side of my page?
    10. How can I specify colors?
    11. How do I change the color of some text?
    12. How can I specify my scrollbar colors?
    13. How can I specify fonts in my Web pages?
 6. Hyperlinks
     1. How do I create a link?
     2. How do I link to a location in the middle of an HTML document?
     3. How do I create a link that opens a new window?
     4. How do I create a link that opens a new window of a specific
        size?
     5. How do I create a button which acts like a link?
     6. How do I create a back button on my page?
     7. How do I create a button that automatically bookmarks my site?
     8. How do I create a button that prints my page?
     9. How do I create a link that sends me email?
    10. How do I specify a subject for a mailto link?
    11. How do I turn off underlining on my links?
    12. How can I have two sets of links with different colors?
    13. How can I make links change when the cursor is over them?
    14. Why are my hyperlinks coming out all wrong or not loading?
    15. Why does my link work in Internet Explorer but not in
        Netscape?
 7. Images
     1. How can I display an image on my page?
     2. Which image format should I use?
     3. How do I link an image to something?
     4. How can I create a thumbnail image that is linked to the
        full-sized image?
     5. How do I link different parts of an image to different things?
     6. How do I eliminate the blue border around linked images?
     7. Why am I getting a colored whisker to the left or right of my
        image?
     8. How do I eliminate the space around/between my images?
     9. Why are my images coming out all wrong or not loading?
    10. How do I make animated GIFs?
    11. How can I display random images?
    12. How do I prevent people from saving my images?
    13. Can I put markup in ALT text?
    14. How do I align an image to the right (or left)?
    15. How can I specify background images?
    16. How do I have a fixed background image?
    17. How do I have a non-tiled background image?
 8. Other Media
     1. How do I let people download a file from my page?
     2. Why did my link to a ... file download a bunch of characters
        instead?
     3. How do I force the browser to download a file? How do I force
        the browser to show/play a file itself? How do I force a file
        to be opened by a particular program?
     4. How do I get an audio file to play automatically when someone
        visits my site?
     5. How can I strip all the HTML from a document to get plain
        text?
 9. Presentational Effects
     1. How can I make a custom rule?
     2. How can I make a list with custom bullets?
     3. Where can I get a "hit counter"?
     4. How do I display the current date or time in my document?
     5. How do I get scrolling text in the status bar?
     6. How do I right align or justify text?
     7. How do I indent the first line in my paragraphs?
     8. How do I indent a lot of text?
     9. How do I eliminate the margins around my page?
    10. How do I do a page break?
    11. How can I have a custom icon when people bookmark my site?
10. HTML Tables
     1. How do I make a table which looks good on non-supporting
        browsers?
     2. Can I nest tables within tables?
     3. How can I use tables to structure forms?
     4. How do I center a table?
     5. How do I align a table to the right (or left)?
     6. Can I use percentage values for ?
     7. Why doesn't  use the full browser width?
     8. Why is there extra space before or after my table?
     9. Are there any problems with using tables for layout?
11. HTML Forms
     1. How do I use forms?
     2. How do I get form data emailed to me?
     3. How can I use tables to structure forms?
     4. How can I eliminate the extra space after a  tag?
     5. How do I make a form so it can be submitted by hitting ENTER?
     6. How do I set the focus to the first form field?
     7. How can I make a form with custom buttons?
     8. Can I have two or more Submit buttons in the same form?
     9. Can I have two or more actions in the same form?
    10. How can I require that fields be filled in, or filled in
        correctly?
    11. Can I prevent a form from being submitted again?
    12. How can I allow file uploads to my web site?
    13. How can I use forms for pull-down navigation menus?
12. HTML Frames
     1. How do I create frames? What is a frameset?
     2. How do I make a link or form in one frame update another
        frame?
     3. Why do my links open new windows rather than update an
        existing frame?
     4. How do I update two frames at once?
     5. How do I get out of a frameset?
     6. How do I make sure my framed documents are displayed inside
        their frameset?
     7. Is there a way to prevent getting framed?
     8. How do I specify a specific combination of frames instead of
        the default document?
     9. How do I remove the border around frames?
    10. How do I make a frame with a vertical scrollbar but without a
        horizontal scrollbar?
    11. How do I change the title of a framed document?
    12. Why aren't my frames the exact size I specified?
    13. Are there any problems with using frames?
    14. Do search engines dislike frames?

Section 1: Preamble

   1.1. Copyright and Disclaimer

    Copyright © 1996-2001 by the Web Design Group. This material may be
    distributed only subject to the terms and conditions set forth in the
    Open Publication License, v1.0 or later (the latest version is
    presently available at http://www.opencontent.org/openpub/).

    This information is offered in good faith and in the hope that it may
    be useful, but it is not guaranteed to be correct, up to date, or
    suitable for any particular purpose. The author accepts no liability
    in respect of this information or its use.

   1.2. Where is the latest version of this document?

    The official home of this document on the Web is:

   * (index of HTML version)

   * (single-file HTML
    version)

   * (single-file text
    version)

    A Dutch translation of this document is available at:

   *

    A French translation of this document is available at:

   *

    NOTE: If you want to mirror the FAQ on your WWW site on a
    publicly-visible server, please make sure you keep it up-to-date.

    Other known sources are:

   *The text version is posted to the newsgroups

    *news:comp.infosystems.www.authoring.html

    *news:comp.answers

    *news:news.answers

   *RTFM and mirror sites:

    *ftp://rtfm.mit.edu/pub/usenet/news.answers/www/authoring-faq

    *http://www.cs.ruu.nl/cgi-bin/faqwais (Europe)

    *http://www.cis.ohio-state.edu/hypertext/faq/usenet/ (USA)

    *Or send email to mailto:mail-server@rtfm.mit.edu with

     send usenet/news.answers/www/authoring-faq

     in the body of your message

   1.3. How can I contribute to this document?

    If you would like to contribute to this FAQ, please send mail to
    . All contributors will be listed in the credits.

   1.4. Can I email the author my questions?

    Please do not ask me questions via email. Please post questions to an
    appropriate public forum, where they will be read (and possibly
    answered/discussed) by many people with more expertise than me. Think
    carefully before posting; you'll get more useful answers if you post
    clear, complete questions.

    If you think something already in the FAQ needs clarifying, or if you
    would like to offer a concise, well-written answer to a frequently
    asked question that is not yet in the FAQ, then feel free to send me
    email.

   1.5. Credits

    All information contained in this FAQ was originally compiled by
    members of the Web Design Group, principally Arnoud "Galactus"
    Engelfriet, John Pozadzides, and Darin McGrew. The Dutch translation
    of this FAQ was prepared by Rijk van Geijtenbeek. The French
    translation of this FAQ was prepared by Cédrik Rousseau.

    Additional input has been provided by Boris Ammerlaan, Martin Atkins,
    Lori Atwater, Alex Bell, Robert Breeser, Stan Brown, Roger Carbol,
    Alex Chapman, Jan Roland Eriksson, Jon Erlandson, Mark Evans, Peter
    Evans, Joe Faulds, Alan Flavell, Rijk van Geijtenbeek, Lucie Gelinas,
    Bjoern Hoehrmann, Tina Marie Holmboe, Cliff Howard, Thomas Jespersen,
    Peter Jones, Nick Kew, Jukka Korpela, Simon Lee, Nick Lilavois, Kelly
    Martin, Neal McBurnett, Glen McDonald, Dan McGarry, Ken O'Brien,
    Timothy Prodin, Steve Pugh, Liam Quinn, Colin Reynolds, Kai Schätzl,
    Randal L. Schwartz, Doug Sheppard, Sue Sims, Toby Speight, Warren
    Steel, Ian Storms, Peter Thomson, Daniel Tobias, Diane Wilson, and no
    doubt others I've forgotten to credit.

    Thanks everyone! Your comments, criticisms, and suggestions have
    considerably improved this FAQ.

Section 2: Other Documents

   2.1. Where can I learn about the WWW?

    The World Wide Web is "the universe of network-accessible information
    (available through your computer, phone, television, or networked
    refrigerator...)." The World Wide Web began as a networked information
    project at CERN.

   *A Little History of the World Wide Web
    

   *About the World Wide Web 

   *W3C in 7 Points 

   2.2. Where can I learn about HTML?

    HyperText Markup Language is a simple markup language used to create
    platform-independent hypertext documents on the World Wide Web. Most
    hypertext documents on the web are written in HTML.

   *W3C's HTML 4.01 Recommendation 

   *WDG's HTML 4.0 Reference
    

   *Jukka Korpela's "Getting Started with HTML"
    

   2.3. Where can I find a list of all the current HTML tags?

    The current recommendation is XHTML 1.0, which is a reformulation of
    HTML 4.01 as an XML 1.0 application. HTML 4.01 is an update with minor
    corrections to HTML 4.0. HTML 4 extends HTML 3.2 to include support
    for frames, internationalization, style sheets, advanced tables, and
    more. The new markup introduced by HTML 4 is not well supported by
    current browsers, but much of it can be used safely in non-supporting
    browsers.

    HTML 4

   *http://www.w3.org/TR/html4/ -- the official HTML 4.01 Recommendation

   *http://www.htmlhelp.com/reference/html40/ -- a handy HTML 4.0
    reference, with notes on using poorly supported features safely

    HTML 3.2

   *http://www.w3.org/TR/REC-html32 -- the official HTML 3.2
    Recommendation

   *http://www.htmlhelp.com/reference/wilbur/ -- a more readable version
    of the above

   *http://www.cs.tut.fi/~jkorpela/HTML3.2/ -- Jukka Korpela's "Learning
    HTML 3.2 by Examples"

    Browser-Specific Markup

   *http://www.blooberry.com/indexdot/html/supportkey/a.htm -- Brian
    Wilson's checklist of browser support for HTML tags and attributes

   *http://developer.netscape.com/docs/manuals/htmlguid/index.htm -- a
    list of Netscape HTML tags (early 1998)

   *http://msdn.microsoft.com/workshop/author/html/reference/elements.asp#ie40_html
    -- a list of Microsoft HTML tags

   2.4. Where can I learn about CSS?

    Cascading Style Sheets are a standards-based mechanism for suggesting
    presentational style (e.g., fonts, colors, layout) for HTML documents.
    CSS is flexible and cross-platform, and is designed to preserve the
    accessibility of the document's structural content (even when all or
    part of the author's style sheet is ignored). A single style sheet can
    be used by multiple documents to suggest a common cohesive style,
    which is more efficient than using repetitive presentational markup in
    each individual document.

   *W3C's CSS Level 2 Recommendation 

   *WDG's Guide to Cascading Style Sheets
    

   *The CSS Pointers Group 

   *The HTML Writers Guild's CSS FAQ
    

   2.5. Where can I learn about SGML?

    Standard Generalized Markup Language is a language used to define the
    syntax of markup languages. HTML is an SGML application (a markup
    language defined in SGML).

   *W3C's "On SGML and HTML"
    

   *A Tutorial Introduction to SGML Architectures
    

   2.6. Where can I learn about XML (XSL)?

    Extensible Markup Language is another language used to define the
    syntax of markup languages. XML is a subset of SGML, and is designed
    to represent arbitrary structured data in a text format. XSL is a
    stylesheet language for styling XML documents.

   *W3C's XML 1.0 Recommendation 

   *W3C's "XML in 10 Points"
    

   *W3C's XSL Specification 

   2.7. Where can I learn about XHTML?

    Extensible HyperText Markup Language is a reformulation of HTML as an
    XML application. Because it is an XML application, the syntax
    requirements of XHTML are more restrictive than those of HTML.
    Otherwise, XHTML 1.0 mirrors the functionality of HTML 4.01.

   *W3C's XHTML 1.0 Recommendation 

   2.8. Where can I learn about SSI ("SHTML")?

     Server-Side Includes allow various directives (e.g., to include the
     content of another file) to be embedded within web documents. The web
     server processes SSI directives each time a document that uses SSI is
     retreived. Documents that use SSI are often identified with a .shtml
     filename extension, but there is no "SHTML" language as such.
     Implementation details vary among web servers; consult your server
     documentation for details.

   * SSI Tutorial for the Apache server
     

   * SSI Documentation for the Apache server
     

   2.9. Where can I learn about CGI?

     Common Gateway Interface is a standard interface between external
     programs and web servers. Unlike static HTML documents, CGI programs
     can produce dynamic information based on form data submitted by the
     user, on information in a database, or on any other data available to
     the program.

   * WDG's CGI Programming FAQ
     .

   * CGI Tutorial for the Apache server
     

   2.10. Where can I learn about JavaScript (LiveScript, JScript,
   EMCAScript, DOM)?

     JavaScript is a cross-platform, interpretted, object-oriented
     language originally designed for client-side web scripting. The
     elements of web pages can be manipulated via JavaScript as objects
     specified by the Document Object Model (DOM). This enables dynamic
     effects like image roll-overs and interactive effects like pages that
     change in response to user input without being reloaded from the
     server.

     LiveScript was Netscape's initial pre-release name for JavaScript.
     JScript is Microsoft's implementation of the language. ECMAScript is
     a standardized version based upon Netscape's JavaScript and
     Microsoft's JScript.

   * ECMA Standard ECMA-262 (ECMAScript Language Specification)
     

   * W3C's Document Object Model, level 2 (DOM2)
     

   * W3C's Document Object Model, level 1 (DOM1)
     

   * Netscape's JavaScript Developer Central (DevEdge Online)
     

   * Microsoft's Scripting Technologies: JScript
     

   * WDG's advice on JavaScript and accessibility
     

Section 3: Getting Started

   3.1. What is everyone using to write HTML?

     It seems that everyone has a different preference for which tool
     works best for them. You may find lists of HTML authoring tools at:

   * http://dir.yahoo.com/Computers_and_Internet/Software/Internet/World_Wide_Web/HTML_Editors/

   * http://www.winfiles.com/ (search "HTML Editors")

   * http://www.tucows.com/ (Win 95, Win 3.x, Macintosh, OS/2)

   * http://shareware.cnet.com/ (search "HTML editor")

     Keep in mind that typically the less HTML the tool requires you to
     know, the worse the output of the HTML. In other words, you can
     always do it better by hand if you take the time to learn a little
     HTML.

   3.2. How can I show HTML examples without them being interpreted as part
   of my document?

     Within the HTML example, first replace the "&" character with "&"
     everywhere it occurs. Then replace the "<" character with "<" and
     the ">" character with ">" in the same way.

     The next Q&A addresses the more general issue of representing
     arbitrary characters in HTML documents.

   3.3. How do I get special characters in my HTML?

      The answer to the previous question addressed the special case of
      the less-than ('<'), greater-than ('>'), and ampersand ('&')
      characters. In general, the safest way to write HTML is in US-ASCII
      (ANSI X3.4, a 7-bit code), 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
      . ISO-8859-1 is
      intended for English, French, German, Spanish, Portuguese, and
      various other western European languages. (It is inadequate for many
      languages of central and eastern Europe and elsewhere, let alone for
      languages not written in the Roman alphabet.) On the Web, these are
      the only characters reliably 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. These
      characters include the em dash, en dash, curly quotes, bullet, and
      trademark symbol; neither the actual character (the single byte) nor
      its &#nnn; decimal equivalent is correct in HTML. Also, ISO-8859-1
      does not include the Euro currency character. (See the last
      paragraph of this answer for more about such characters.)

      On platforms whose own character code isn't ISO-8859-1, such as
      MS-DOS and Mac OS, there may be problems: you 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,
      but this FAQ is too small to cover other possibilities in detail.
      Mac users - see the notes at
      .

      If you run a web server (httpd) on a platform whose own character
      code isn't ISO-8859-1, such as a Mac or an IBM mainframe, then 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 not in ISO-8859-1, you must use HTML 4
      or XHTML rather than HTML 3.2, choose an appropriate alternative
      character set (and for certain character sets, choose the encoding
      system too), and use one method or other of specifying this. See the
      HTML 4.01 Recommendation at  and
      the Babel site at  for more
      details. Another useful resource for internationalization issues is
      at .

    3.4. Should I put quotes around attribute values?

      It is never wrong to quote attribute values, and many people
      recommend quoting all attribute values even when the quotation marks
      are technically optional. XHTML 1.0 requires all attribute values to
      be quoted. Like previous HTML specifications, HTML 4 allows
      attribute values to remain unquoted in many circumstances (e.g.,
      when the value contains only letters and digits). See
       for
      the exact rules.

      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:

    * Escape any quotes inside the value with " so you don't terminate
      the value prematurely: ALT="the "King of Comedy" takes a
      bow". (" is not part of the formal HTML 3.2 spec, though most
      current browsers support it.)

    * Use single quotes to enclose the attribute value: ALT='the "King of
      Comedy" takes a bow'.

      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".

    3.5. How can I include comments in HTML?

      A comment declaration starts with "". A comment starts and ends with "--", and
      does not contain any occurrence of "--" between the beginning and
      ending pairs. This means that the following are all legal HTML
      comments:

    * 

    * 

    * 

    * 

    * 

      But some browsers do not support the full syntax, so we recommend
      you follow this simple rule to compose valid and accepted comments:

        An HTML comment begins with "", and does
        not contain "--" or ">" anywhere in the comment. Do not put
        comments inside tags (i.e., between "<" and ">") in HTML
        markup.

      See 
      for a more complete discussion.

    3.6. How can I avoid using the whole URL?

      The URL structure defines a hierarchy similar to a filesystem's
      hierarchy of subdirectories or folders. The segments of a URL are
      separated by slash characters ("/"). When navigating the URL
      hierarchy, the final segment of the URL (i.e., everything after the
      final slash) is similar to a file in a filesystem. The other
      segments of the URL are similar to the subdirectories and folders in
      a filesystem.

      A relative URL omits some of the information needed to locate the
      referenced document. The omitted information is assumed to be the
      same as for the base document that contains the relative URL. This
      reduces the length of the URLs needed to refer to related documents,
      and allows document trees to be accessed via multiple access schemes
      (e.g., "file", "http", and "ftp") or to be moved without changing
      any of the embedded URLs in those documents.

      Before the browser can use a relative URL, it must resolve the
      relative URL to produce an absolute URL. If the relative URL begins
      with a double slash (e.g., //www.htmlhelp.com/faq/html/), then it
      will inherit only the base URL's scheme. If the relative URL begins
      with a single slash (e.g., /faq/html/), then it will inherit the
      base URL's scheme and network location.

      If the relative URL does not begin with a slash (e.g., all.html ,
      ./all.html or ../html/), then it has a relative path and is resolved
      as follows.

   1. The browser strips everything after the last slash in the base
      document's URL and appends the relative URL to the result.

   2. Each "." segment is deleted (e.g., ./all.html is the same as
      all.html, and ./ refers to the current "directory" level in the URL
      hierarchy).

   3. Each ".." segment moves up one level in the URL hierarchy; the ".."
      segment is removed, along with the segment that precedes it (e.g.,
      foo/../all.html is the same as all.html, and ../ refers to the
      parent "directory" level in the URL hierarchy).

      Some examples may help make this clear. If the base document is
      , then

      all.html and ./all.html
           refer to 
      ./
           refers to 
      ../
           refers to 
      ../cgifaq.html
           refers to 
      ../../reference/
           refers to 

      Please note that the browser resolves relative URLs, not the server.
      The server sees only the resulting absolute URL. Also, relative URLs
      navigate the URL hierarchy. The relationship (if any) between the
      URL hierarchy and the server's filesystem hierarchy is irrelevant.

      For a full discussion of the proper form of URLs, see
      .

    3.7. Should I end my URLs with a slash?

      The URL structure defines a hierarchy similar to a filesystem's
      hierarchy of subdirectories or folders. The segments of a URL are
      separated by slash characters ("/"). When navigating the URL
      hierarchy, the final segment of the URL (i.e., everything after the
      final slash) is similar to a file in a filesystem. The other
      segments of the URL are similar to the subdirectories and folders in
      a filesystem.

      When resolving relative URLs (see the answer to the previous
      question), the browser's first step is to strip everything after the
      last slash in the URL of the current document. If the current
      document's URL ends with a slash, then the final segment (the
      "file") of the URL is null. If you remove the final slash, then the
      final segment of the URL is no longer null; it is whatever follows
      the final remaining slash in the URL. Removing the slash changes the
      URL; the modified URL refers to a different document and relative
      URLs will resolve differently.

      For example, the final segment of the URL
      http://www.htmlhelp.com/faq/html/ is empty; there is nothing after
      the final slash. In this document, the relative URL all.html
      resolves to http://www.htmlhelp.com/faq/html/all.html (an existing
      document). If the final slash is omitted, then the final segment of



Section 1 of 5 - Prev - Next
All sections - 1 - 2 - 3 - 4 - 5

Back to category www - Use Smart Search
Home - Smart Search - About the project - Feedback

© allanswers.org | Terms of use

LiveInternet