Udostępnij za pośrednictwem


How to: Insert HTML Hyperlinks and Bookmarks in Design View

Hyperlinks and bookmarks are important tools for helping users to navigate quickly within and across Web pages to the content that they need.

When clicked, a hyperlink attempts to find an HTML document and open it in the Web browser. It locates this new document using a Uniform Resource Locator (URL) string. For example, the hyperlink <A HREF="mypage.htm"> looks in the current folder for a page named mypage.htm, and then displays this page in the current frame.

  1. In Design view, open your Web page for editing.

  2. Select the text or image to use as a hyperlink.

  3. On the Format menu, click Convert to Hyperlink.

    The Hyperlink dialog box appears.

  4. In the URL box, type the path to the resource or click the Browse button and navigate to the target page or file, and then click OK.

The target attribute specifies the browser window in which the hyperlink is displayed. You can enter the actual name of the target window or use special terms, such as parent or top, to express the position of the target window relative to the current one. If the target attribute is not set, the hyperlink displays the target page in the current browser window.

  1. Select the hyperlink

  2. In the Properties window, in the Target box enter the name of the target window or select a special term.

A bookmark creates a location within an HTML document to which a hyperlink can jump (for example, <a name="anchor">).

To insert a bookmark

  1. In Design view, place the cursor on the page at the location that you want to bookmark.

  2. On the Format menu, click Insert Bookmark.

    The Bookmark dialog box appears.

  3. Type a name for the bookmark, and then click OK.

    Now you can make this bookmark the target of a hyperlink.

You can create a hyperlink that scrolls the current HTML document to a location that was previously marked by an anchor. The Web browser locates this anchor using an abbreviated URL (for example, <a href="#anchor">).

  1. Select the text or image for the user to use as a hyperlink.

  2. On the Format menu, click Convert to Hyperlink.

    The Hyperlink dialog box appears.

  3. In the Type list, select (other).

  4. In the URL box, type a pound sign (#) and the bookmark name (for example, #anchor), and then click OK.

See Also

Reference

Hyperlink Dialog Box