为脚本链接指定HTML目录的根路径? [英] Specify a Root Path of your HTML directory for script links?

查看:112
本文介绍了为脚本链接指定HTML目录的根路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为dreamweaver编写一个模板,并且不想更改子文件夹页面的脚本。

I'm writing a template for dreamweaver, and don't want to change the scripts for subfolder pages.

有没有办法让路径相对于根目录?

Is there a way to make the path relative to the root directory?

例如:

for example:

<link type="text/css" rel="stylesheet" href="**root**/style.css" />

而不是 ** root ** 以上,我想要一个默认路径。有什么办法可以做到这一点?

Instead of **root** above, I want a default path there. Is there any way to do anything like this?

推荐答案

相对于根目录,只需使用 /

To be relative to the root directory, just start the URI with a /

<link type="text/css" rel="stylesheet" href="/style.css" />
<script src="/script.js" type="text/javascript"></script>

这篇关于为脚本链接指定HTML目录的根路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆