【问题标题】:Link stylesheet from a parent folder从父文件夹链接样式表
【发布时间】:2015-09-21 21:06:43
【问题描述】:

我有以下文件夹设置:

Main
    css
        stylesheet.css
    sub
        example
            index.php
    index.php

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

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

这仅适用于主要部分中的index.php

【问题讨论】:

    标签: php html css


    【解决方案1】:

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

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

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

    【讨论】:

      【解决方案2】:

      试试

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

      【讨论】:

      • 您需要返回两个目录才能获得stylesheet.css
      猜你喜欢
      • 1970-01-01
      • 2012-10-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-08
      • 2015-01-05
      • 1970-01-01
      相关资源
      最近更新 更多