douzhuangna6906 2013-05-24 13:47
浏览 22
已采纳

为什么我的CSS / PHP样式表没有应用到我的网站?

I am using following (simplified) code for my PHP stylesheet

<?php header("Content-type: text/css; charset: UTF-8"); ?>      
/* Our dynamic styles go here */
/* We will check BOTH sidebars are there so we can adjust width of our content */
<?php if ( is_active_sidebar('secondary') && is_active_sidebar('main') ) {

 ?>

 #blogs{
 float: right;
 width: 530px;
 }

<?php } ?>

Now when I view source of my webpage I am getting this (exactly as should be):

<link rel="stylesheet" type="text/css" media="all" href="http://www.mypage.com/wordpressdevelopment/wp-content/themes/Endless_Theme/functions/dynamic_css.php">

So when I click my link above (Endless_Theme/functions/dynamic_css.php)
I am getting this output (so now I know that my PHP/CSS script is working) :

/* Our dynamic styles go here */
/* We will check BOTH sidebars are there so we can adjust width of our content */
   #blogs{
   float: right;
   width: 530px;
   }

But the problem is that my CSS/PHP is not being applied to my webpage!
Can someone tell me please what I am doing wrong here?

You can see my PAGE HERE

It should display one sidebar on right side and another on left side but it is not working (but strange thing is that same code IS WORKING on my LOCALL machine).

  • 写回答

2条回答 默认 最新

  • dswwuo1223 2013-05-24 13:54
    关注

    Your file isn't valid CSS. Try cutting out the commented chunks of PHP - I suspect you'll find it works then!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿