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条)

报告相同问题?

悬赏问题

  • ¥20 delta降尺度方法,未来数据怎么降尺度
  • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效
  • ¥15 再不同版本的系统上,TCP传输速度不一致
  • ¥15 高德地图点聚合中Marker的位置无法实时更新
  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程