This is a very basic html question, but I can't seem to locate the answer.

这是一个非常基本的HTML问题,但我似乎找不到答案。

I have a local file located here:

我在这里有一个本地文件:

/Users/Me/Desktop/Main/June/foo.txt

In an .html document located within the /Main directory, I can link to the foo.txt file using the full path:

在位于/ Main目录中的.html文档中,我可以使用完整路径链接到foo.txt文件:

<a href="file:///Users/Me/Desktop/Main/June/foo.txt">Full Path Link</a>

I would like to use relative paths to link to foo.txt. Does anyone know how to create a relative path link to this foo.txt file?

我想使用相对路径链接到foo.txt。有谁知道如何创建这个foo.txt文件的相对路径链接?

I tried the code below and a number of similar permutations, but I can't seem to successfully write the relative path link for this local file.

我尝试了下面的代码和一些类似的排列,但我似乎无法成功写入此本地文件的相对路径链接。

<a href="file:///../June/foo.txt">Relative path Link</a>

Thanks in advance. Any help is appreciated.

提前致谢。任何帮助表示赞赏。

2 个解决方案

#1


28

Remove the file:/// part to have just ../June/foo.txt.

删除文件:///部分只有../June/foo.txt。

This should help you out.

这应该可以帮到你。

更多相关文章

  1. 在页面重新加载时添加活动链接和jquery幻灯片切换到自定义ajax w
  2. 如何将这些Twitter bootstrap 3导航栏链接集中在一起?
  3. PHP的目录路径问题
  4. thinkphp友情链接代码
  5. php 获取当前页面url路径
  6. wordpress永久链接重新加载页面,而不是重定向到发布
  7. 解决PHP导出大量数据时设置超链接的问题
  8. 如何使用Amazon S3创建一次性下载链接?
  9. PHP 站点相对包含,路径的问题解决方法(include,require)

随机推荐

  1. 超炫的android 3d ui,目前正在内测中 期待
  2. 给女朋友讲解什么是代理模式
  3. Android使用ShareSDK集成第三方登录和分
  4. android EditText软键盘隐藏总结
  5. Android(安卓)Activity跳转出现白屏但不
  6. 面试官:给我说说什么是中间人***?
  7. 从Generator到Async function
  8. Android怎么快速建立TCP连接
  9. ViewPager+Fregment布局滑动
  10. 安装Android(安卓)Studio没有AndroidSDK