从父文件夹链接样式表

fro*_*sty 5 html css php

我有以下文件夹设置:

Main
    css
        stylesheet.css
    sub
        example
            index.php
    index.php
Run Code Online (Sandbox Code Playgroud)

如何链接stylesheet.css到中的index.php文件example

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

这仅适用index.php于“主要”部分。

Man*_*mar 5

您可以像这样返回两个目录: ../../

../ 用于填充相对路径结构。

<link rel="stylesheet" type="text/css" href="../../css/stylesheet.css">
Run Code Online (Sandbox Code Playgroud)