PHP Routing - stylesheets have no effect

后端 未结 1 616
生来不讨喜
生来不讨喜 2021-01-27 10:24

I have created a basic Routing-system in PHP. The url is split into an array, so that i can decide what to show depending on the URL (ex: www.domain.com/page/option/param).

相关标签:
1条回答
  • 2021-01-27 10:46

    With most rewriting of "fake" or friendly URL's, you need to specify the location of the stylesheet either using absolute path or using the base tag in the head section.

    e.g.

    <base href="http://example.com" />
    <link href="css/style.css" rel="stylesheet" type="text/css" />
    //The CSS file above will load from http://example.com/css/style.css
    

    OR

    You can add a back slash before the path in the link tag so that it starts at the root directory.

    <link href="/path/to/style.css" rel="stylesheet" type="text/css" />
    
    0 讨论(0)
提交回复
热议问题