Home >> FAQs/Tutorials >> XHTML Tutorials and Tips >> Index

XHTML Tutorial - Defining a Bookmark

By: FYIcenter.com

(Continued from previous topic...)

How To Define a Bookmark?

A bookmark is a named reference point in a XHTML document. If a bookmark can be included in the URL that represents this document, the browser will automatically move the display window to the reference point as soon as the document is open.

If you want to define a bookmark in your XHTML document, you need to use an "a" element with the "name" attribute. Here are basic rules about defining a bookmark with "a" element:

  • An "a" element with the "name" attribute defines a bookmark.
  • The "name" attribute is used to specify a name for this reference point.
  • The content of the "a" element could be empty.
  • The content of the "a" element will be display normally by most browsers. This makes a bookmark invisible.

Here is a good tutorial example of bookmark elements:

<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  <title>Bookmark Elements</title>
  <h3>XHTML FAQ by FYIcenter.com</h3>

  <h4><a name="101">Question 101</a> 
   - What is XHTML?</h4>
  <p>XML + HTML.</p>

  <h4><a name="201">Question 201</a>
   - Where can I download XHTML 1.0?</h4>

  <h4><a name="301">Question 301</a>
   - How to install XHTML 1.0?</h4>
  <p>Nobody knows.</p>

If you save the above document as bookmark.html, and view it with Internet Explorer, you can not see any signs of bookmarks. But they embedded in all section titles:

(Continued on next topic...)

  1. What Are Hyper Links?
  2. What Is an Anchor "a" Tag/Element?
  3. How To Define a Hyper Link?
  4. How To Define a Bookmark?
  5. What Is a URL?
  6. What Is the Structure of a URL?
  7. What Happens If Protocol or Port Number Is Missing in a URL?
  8. What Happens If a URL Starts with Path or File name?
  9. What Is a Relative Path Name?
  10. What Happens If File Name is Missing in a URL?
  11. How To Build Hyper Link Indexes within the Same Document?
  12. What Happens If a Hyper Link Points to an Image?
  13. What Happens If a Hyper Link Points to a Music File?
  14. What Happens If a Hyper Link Points to a PDF File?
  15. What Happens If a Hyper Link Points to a ZIP File?
  16. How To Create A Link to Open a Document in a New Window?

Selected Developer Jobs: