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

XHTML 1.0 Tutorials - Understanding Hyper Links and URLs

By: FYICenter.com

Part:   1  2   3  4  5  6 

(Continued from previous part...)

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"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
 <head>
  <title>Bookmark Elements</title>
 </head>
 <body>
  <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>
  <p>Nowhere.</p>

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

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:
            Bookmarks

What Is a URL?

A URL (Uniform Resource Locator) is a reference name representing a location of a Web document or other resource that is available on the Internet. Here are some examples of URLs:

  • "http://www.w3.org/"
  • "http://dev.fyicenter.com/faq/xhtml/"
  • "http://www.google.com/search?hl=en&q=xhtml"
  • "http://www.free-nature-animal-butterfly-wallpaper.com/wallpapers/xanimal18.jpg"
  • "http://www.google.com/help/faq.html#narrow"
  • "http://localhost:8080/"
  • "ftp://ftp.novell.com/"
  • "/index.html"

What Is the Structure of a URL?

The structure of a URL is defined by the URL specification, see http://www.ietf.org/rfc/rfc2396.txt. Generally, a URL consists of 7 parts:

  • Protocol Name - Identifies the communication protocol through which this resource is made available, like "http://" or "ftp://".
  • Host Name - Identifies the computer host that manages this resource, like "www.w3.org", or "dev.fyicenter.com".
  • Port Number - Identifies the communication port where hosting computer is taking requests, like ":8080".
  • Path Name - Identifies the directory where the resource is located, like "/", or "/faq/".
  • File Name - Identifies the file name of the resource, like "index.html", or "xanimal18.jpg".
  • Bookmark - Identifies a bookmark within the target document, like "#narrow".
  • Query String - Provides parameters to the resource manager, like "?hl=en&q=xhtml".

If you have a URL, you can easily break it into parts. For example, "http://www.fyicenter.com:8080/faq/xhtml/index.html#footer?q=test" can be broken into 7 parts like this:

  • "http://" - Protocol Name.
  • "www.fyicenter.com"- Host Name.
  • ":8080" - Port Number.
  • "/faq/xhtml/" - Path Name.
  • "index.html" - File Name.
  • "#footer" - Bookmark.
  • "?q=test" - Query String.

(Continued on next part...)

Part:   1  2   3  4  5  6 


Selected Developer Jobs:

More...