从所有html页面调用.htc文件而不添加url域

发布于 2024-11-15 07:25:57 字数 333 浏览 6 评论 0原文

在同一 CSS 规则中,添加以下样式行:

behavior: url(path/to/PIE.htc);

当然,您需要调整路径以匹配您在步骤 2 中上传 PIE.htc 的位置。注意:此路径是相对于正在查看的 HTML 文件,而不是 CSS 文件它被称为来自。

则不再加载PIE.htc

behavior: url(PIE.htc); 

但如果我的网址是domain.com/foo/foo.html 如果我使用PIE.htc 位于根目录中, 。我可以以某种方式始终从根目录调用 .htc 文件吗?

In that same CSS rule, add the following style line:

behavior: url(path/to/PIE.htc);

Of course you will need to adjust the path to match where you uploaded PIE.htc in step 2. Note: this path is relative to the HTML file being viewed, not the CSS file it is called from.

but if my url is domain.com/foo/foo.html PIE.htc is not loaded any more if i use

behavior: url(PIE.htc); 

PIE.htc is located in root. Can i somehow always call .htc file from root?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

双马尾 2024-11-22 07:25:57

/ 开头的 URI 相对于站点根目录。

URIs starting with a / are relative to the site root.

渔村楼浪 2024-11-22 07:25:57

行为属性要求使用 URL() 语法指定 HTC 文件的 URI。可以使用空格分隔的列表引用多个 HTC 文件。

因此,假设您的 csshover.htc 文件位于 csshover 目录中,并且您可以引用多个 HTC 文件或特别是相同的文件,但来自不同的目录
就像 行为: URL('csshover/csshover.htc') URL('../csshover/csshover.htc') URL('../../csshover/csshover.htc') URL('.. /../../csshover/csshover.htc'); 等等。

The behavior property requires the URI to the HTC file to be specified using the URL() syntax. Multiple HTC files can be referenced with a space-delimited list.

So suppose your csshover.htc file is in csshover directory and you can reference multiple HTC file or specially same file but from different directories
like behavior: URL('csshover/csshover.htc') URL('../csshover/csshover.htc') URL('../../csshover/csshover.htc') URL('../../../csshover/csshover.htc'); and so on.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文