简体   繁体   English

如何通过此途径将CSS链接到HTML(图片)

[英]How to link css to html with this pathway (image)

Pathway image 通路图像

I would like to link style.css to my to my html page ATC1O.html. 我想将style.css链接到我的html页面ATC1O.html。 I added more periods after 'href="' but that is not working. Is there a way to link this at all? 我在'href =“'之后添加了多个句点,但这没有用。是否有办法链接这个?

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

Try "../../css/style.css" or "../../../css/style.css". 尝试“ ../../css/style.css”或“ ../../../css/style.css”。

It's kind of hard to know how deep ATC10.html is from your image. 很难知道图像中的ATC10.html有多深。 All I know is that its not the direct parent. 我所知道的不是它的直接父母。

try the following: 尝试以下方法:

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

more info here 更多信息在这里

../../../css/style.css

./ represents current directory, so this is dance ./代表当前目录,所以这是舞蹈

../ represents the parent directory, so this will be art ../代表父目录,所以这将是艺术

../../ represents Parent's parent directory, so document ../../代表Parent的父目录,因此文档

../../../ represents Parent's parent's parent directory, which you have not shown in the image, but it contains the "document" the "css" directory. ../../../代表上级的上级目录,您没有在图像中显示它,但是它包含“文档”和“ css”目录。 So we go into it and then choose the /css/style.css file. 因此,我们进入其中,然后选择/css/style.css文件。

Hope It isn't confusing! 希望不要混淆!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM