如何链接目录下另一个文件夹中的CSS样式表? [英] How do I link a CSS stylesheet from another folder below in the directory?

查看:122
本文介绍了如何链接目录下另一个文件夹中的CSS样式表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这就是我要链接到HTML中的内容,但我尝试取消这两个时间段却无法正常工作.

This is what I'm trying to link into my HTML and it's not working I tried taking off the two periods and that doesn't work either.

<link rel="stylesheet" style="text/css" href="..CSS/file.css">

推荐答案

在您的情况下:

<link rel="stylesheet" style="text/css" href="../CSS/file.css">

更多案例:

您可以使用../

所以对于每个../,您将上移1个目录

So for each ../ you will go up 1 directory

如果您在/public/files/中可以

<link rel="stylesheet" style="text/css" href="../CSS/file.css">

进入/public/CSS/

如果您需要访问根目录,可能是:

If you need to acces the root it could be:

<link rel="stylesheet" style="text/css" href="../../file.css">

进入/

您也可以从当前脚本目录链接它:

You can also link it from the current script directory:

<link rel="stylesheet" style="text/css" href="./CSS/file.css">

如果您在/public/files/中,则为/public/files/CSS/

最后一次从根目录到目录:

And last from root to the directory:

<link rel="stylesheet" style="text/css" href="/public/CSS/file.css">

应该是/public/CSS/和您的文件

这篇关于如何链接目录下另一个文件夹中的CSS样式表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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