Accessibility

TechNote (Archived)

Link to named anchor fails in the browser

Issue


A link to a named anchor does not work as expected in the browser. When the link is clicked, the browser may navigate to the top (or, more infrequently, the bottom) of the document rather than to the anchor's location on the page.

Reason


There are several possible reasons for the failure of a link to a named anchor. These include:

  • The named anchor is in a layer. Links to anchors inside of Layers often fail in Netscape.
  • The anchor name may contain characters which cause the link to fail.
    • The anchor name has a space.
    • The anchor name has a capital letter, and the link does not. Remember that these links are case-sensitive.
  • The named anchor is inside of a table. The browser may navigate to the top or the bottom of the table instead of to the anchor point within the table.
  • The named anchor is inside of another link.

Solution


  • Avoid placing a named anchor in a layer.
  • Use unique, lowercase, single-word alphanumeric names for named anchors. Begin each anchor name with a letter and, instead of using a space to separate words in your name, use the underscore ( _ ) character.
  • Define the named anchor outside of the table. For instance, you might break the table into several tables and then insert the named anchor between the tables.
  • When inserting a named anchor, do not insert it into another link.

A link that targets a named anchor should look something like this: otherpage.htm#first_anchor.

Additional Information


For more details on naming anchors or files, consult Naming strategies for Dreamweaver, Ultra Dev, and various interpreters (TechNote 14610).

AlertThis content requires Flash

To view this content, JavaScript must be enabled, and you need the latest version of the Adobe Flash Player.

Download the free Flash Player now!

Get Adobe Flash Player

Creative Commons License

Search Support


Document Details

ID:tn_15056

Products Affected:

dreamweaver