When dealing with a lot of connections on web pages, it is often confused by some relative paths. Now, it is a reminder. In fact, it is very simple, but it is always hard to remember. Ah
We usually encounter the following three cases of relative paths. The following is an example.
1. path with the letter "/" as the header, the complete path will be the host name plus the path name
<A href = "/article/index.html"> Article </a> actually points to: http: // hostname/article/index.html
2. The complete path of the path starting with no slash will be the path above the current URL with this path name
<A href = "Article/index.html"> Article </a>: if the current webpage address is http: // hostname/book/list.html
Then, the connection will go to http: // hostname/book/article/index.html
3. One to n. the path starting with a slash. In fact, the whole path will be the path from the top level to N level of the current URL plus the path name. The second case is a special example of this situation.
<A href = "./article/index.html"> Article </a>. If the current page address is http: // hostname/book/list.html
Then, the connection will go to http: // hostname/book/article/index.html
<A href = "../article/index.html"> Article </a>. If the current page address is http: // hostname/book/list.html
Then, the connection will go to http: // hostname/article/index.html