在没有根目录的情况下链接我的样式表,以便可以在任何地方使用该文件夹
Linking my stylesheet without the root so can use the folder anywhere
我将我的样式表 customstyle.css
链接到我的 index.html
,但是当我将文件夹复制到另一个驱动器时,样式表不会链接 我如何解决这个问题,因为我必须将文件夹发送到另一个人
<link rel="stylesheet" type="text/css" href="D:\healthplus\style.css">
确保 index.html
和 customstyle.css
在同一个文件夹中。然后在 index.html 你应该 link 你的样式表是这样的:
<link rel="stylesheet" type="text/css" href="customstyle.css">
这是一个相对路径,因为它不是以 /
开头
我将我的样式表 customstyle.css
链接到我的 index.html
,但是当我将文件夹复制到另一个驱动器时,样式表不会链接 我如何解决这个问题,因为我必须将文件夹发送到另一个人
<link rel="stylesheet" type="text/css" href="D:\healthplus\style.css">
确保 index.html
和 customstyle.css
在同一个文件夹中。然后在 index.html 你应该 link 你的样式表是这样的:
<link rel="stylesheet" type="text/css" href="customstyle.css">
这是一个相对路径,因为它不是以 /