Creating Links question

2007-04-28 6:22 am
1. What code to link the text,"About me",to the about.htm file?(both file in same folder)

2. What code to link the text,"My Hobby",to the location with the id or anchor name of "hobby"within a different file named hobby.htm?

3. What`s the difference between an absolute path and a relative path?

回答 (1)

2007-04-28 10:51 am
✔ 最佳答案
1.
<a href="about.htm">About me</a>

2.
<a href="hobby.htm#hobby">My Hobby</a>

3.
relative path means it is relative to something
for example, the above about.htm

if you link it in www.xxx.com/yyy
then it becomes www.xxx.com/yyy/about.htm

if you link it in www.xxx.com/zzz/yyy
then it becomes www.xxx.com/zzz/yyy/about.htm

i.e. the real path is relative to the current location

On the otherh and, http://www.xxx.com/yyy/about.htm specifies an absolute path
This will go to the same location, no matter what is the current location


收錄日期: 2021-04-23 16:56:15
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20070427000051KK04775

檢視 Wayback Machine 備份