douqingnao9246 2014-07-20 23:41
浏览 33
已采纳

Css包含在PHP中实现modrewrite时不工作

I am working on wamp. the link to my site is : localhost/tshirtshop/

Before rewriting it is : localhost/tshirtshop/index.php?product=12

After rewriting it is : localhost/product-title-p12

Problem: Everything is working fine. but the problem is with Css files.

This file is not including.. when i saw the source code (Ctrl+U) the path is like this :

localhost/tshirtshop/product-title-p12/styles/tshirtshop.css

What i tried:

I tried this

<style>
    <?php include 'styles/tshirtshop.css';
   </style>

It works but not a solution for me. as there are some other images to be included also i.e logo which results as this path: localhost/tshirtshop/product-title/images/tshirtshop.png

It might be a very easy solution. But i am facing problem since one hour. i tried googling for similar problems but not found any. so please dont mind. and sorry for my english.

  • 写回答

4条回答 默认 最新

  • duanboshe0001 2014-07-20 23:49
    关注

    use absolute path like

    <link rel="stylesheet" type="text/css" href="http://localhost/tshirtshop/styles/tshirtshop.css" />
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 DS18B20内部ADC模数转换器
  • ¥15 做个有关计算的小程序
  • ¥15 MPI读取tif文件无法正常给各进程分配路径
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下
  • ¥15 setInterval 页面闪烁,怎么解决
  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动