本地连接启用连接失败
For small sites of less than a dozen pages, the easiest way to link an HTML page to another resource is to ensure that files are next to each other, i.e. in the same location. In our example, we will assume that you are trying to link from one page to another: creating a link on page1.html
to go to page2.html
. In that case you would write:
对于少于十二个页面的小型站点,将HTML页面链接到另一资源的最简单方法是确保文件彼此相邻,即在同一位置。 在我们的示例中,我们假设您尝试从一个页面链接到另一页面:在page1.html
上创建链接以转到page2.html
。 在这种情况下,您将编写:
<a href="page2.html">Go to Page 2</a>
Note that nothing else is needed for information - the web browser assumes that page2.html
is in the same location as the page it is linked to. If the pages were in
请注意,信息不需要任何其他信息page2.html
浏览器假定page2.html
与链接到的页面位于同一位置。 如果页面在 在不同的位置,我们需要添加路径信息 。 您绝对不应以绝对格式编写本地链接:如果您的域名或站点结构发生更改,则该链接将停止工作。
本地连接启用连接失败