Change Font Size:

HTML relative path (Relative Path) and the absolute path (Absolute Path)

HTML beginners often encounter such a problem, how to correctly use a document. For example, how an HTML page quoted another HTML pages as hyperlinks (hyperlink)? How a web page to insert a picture? ...... Related Guide: HTML hyperlinks; HTML Photo)

If you invoke the documents (such as by adding hyperlinks, or insert a picture, etc.), the use of the wrong file path will lead to failure quote (not to link documents, or insert the picture can not be displayed, etc.).

To avoid these mistakes, the paper quoted correctly, we need to learn about HTML path.

HTML has two kinds of writing path: absolute and relative paths path.

HTML relative path (Relative Path)

With the paper quoted a directory

If the source files and documents cited in the same directory, direct write the file name can be invoked.

We are building a source document info.html, index.html info.html, to use paper as a hyperlink.

Assumptions info.html path is: c: \ Inetpub \ wwwroot \ sites \ nt22 \ info.html
Assumptions index.html path is: c: \ Inetpub \ wwwroot \ sites \ nt22 \ index.html
Index.html info.html joined in the hyperlink code should be written like this:

  <a Href = "index.html" /> index.html </ a> 

How that Directorio

.. / Source said that the file directory, a directory ,../../ said the source file directory on the higher-level directory, and so on.

Assumptions info.html path is: c: \ Inetpub \ wwwroot \ sites \ nt22 \ info.html
Assumptions index.html path is: c: \ Inetpub \ wwwroot \ sites \ index.html
Index.html info.html joined in the hyperlink code should be written like this:

  <a Href = "../index.html" /> index.html </ a> 

Assumptions info.html path is: c: \ Inetpub \ wwwroot \ sites \ nt22 \ info.html
Assumptions index.html path is: c: \ Inetpub \ wwwroot \ index.html
Index.html info.html joined in the hyperlink code should be written like this:

  <a Href = "../../index.html" /> index.html </ a> 

Assumptions info.html path is: c: \ Inetpub \ wwwroot \ sites \ nt22 \ info.html
Assumptions index.html path is: c: \ Inetpub \ wwwroot \ sites \ wowstory \ index.html
Index.html info.html joined in the hyperlink code should be written like this:

  <a Href = "../wowstory/index.html" /> index.html </ a> 

How said that the lower level directory

Contents of the document cited lower-level, direct-write the document directory path.

Assumptions info.html path is: c: \ Inetpub \ wwwroot \ sites \ nt22 \ info.html
Assumptions index.html path is: c: \ Inetpub \ wwwroot \ sites \ nt22 \ html \ index.html
Index.html info.html joined in the hyperlink code should be written like this:

  <a Href = "html/index.html" /> index.html </ a> 

Assumptions info.html path is: c: \ Inetpub \ wwwroot \ sites \ nt22 \ info.html
Assumptions index.html path is: c: \ Inetpub \ wwwroot \ sites \ nt22 \ html \ tutorials \ index.html
Index.html info.html joined in the hyperlink code should be written like this:

  <a Href = "html/tutorials/index.html" /> index.html </ a> 

HTML absolute path (Absolute Path)

HTML absolute path (absolute path) refers to domain names with the integrity of the document path.

Suppose you have their domain names registered www.nt22.com and apply for the virtual console, your virtual mainframe provider will give you a directory, such as www, this is your web site www the root directory.

Suppose you in the root directory www decentralization a document index.html, this document is the absolute path: http://www.nt22.com/.

Suppose you in the root directory www the building of a directory called html_tutorials, and then in the directory of a decentralization document index.html, this document is http://www.nt22.com/html_tutorials/index.html absolute path.