How to use relative paths for included files such as .css

后端 未结 8 1247
梦如初夏
梦如初夏 2020-12-29 15:07

I have a header.php file which contains a .css file link.

When I \"include\" header.php into another php file in different fo

相关标签:
8条回答
  • 2020-12-29 15:43

    Write the absolute path of the css file like:

    <link href="http://site.com/css/style.css" />

    0 讨论(0)
  • 2020-12-29 15:49

    Like this:

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

    The first / says "Go to the root directory and look from there". It's a relative path.

    0 讨论(0)
提交回复
热议问题