douhuigang9550 2010-02-07 23:22
浏览 41
已采纳

通过PHP生成的CSS在Firefox中被忽略但在Chrome,IE8中有效

i have a weird problem where css generated via php (stuck with a weird cms from an even weider programmer) is ingored by firefox 3.X and probably earlier. But the page loads ok in other browsers like IE7/8 and chrome. Also firebug doesn't see the css either but when i point my browser to the php-css-generation script it show me a plain page with css code

<link rel="stylesheet" type="text/css" href="app/style.php?PageID=224&Admin=">

does anybody know where should i look for some answers or how to possibly fix this? Could there be a problem with that "&Admin=" part?

  • 写回答

2条回答 默认 最新

  • dpbsy60000 2010-02-07 23:23
    关注

    The most likely cause is that you are using PHP's default Content-Type output of text/html so Firefox thinks:

    This is a stylesheet written in HTML, a stylesheet language I don't understand and will therefore ignore.

    The other browsers are, presumably, compensating for the error.

    Add:

    header('Content-type: text/css');
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘