正在读取服务器上的IE css



我有一个基于wordpress的网站,当我在localhost上工作时,我使用此代码读取css:

<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>">
<!--[if IE]>
    <link rel="stylesheet" href="<?php echo get_stylesheet_directory()."/ie.css"; ?>" media="screen" type="text/css" />
<![endif]-->

正如你所看到的,代码的第二部分是当我在InternetExplorer上查看网站时更改css。碰巧这在examplep上运行得很好,但现在,在迁移到在线服务器后,代码的第二部分不起作用,当我在IE上看到在线页面时,样式也不适用。

有什么线索表明为什么会发生这种情况吗?

 <?php get_stylesheet_directory() ?>

返回一个绝对的服务器路径;

http://codex.wordpress.org/Function_Reference/get_stylesheet_directory

将代码更改为;

 <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>">
 <!--[if IE]>
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/ie.css"; ?>" media="screen" type="text/css" />
 <![endif]-->

它应该对你有用。

最新更新