2017-06-30 42 views
0

我已經在template.php文件中創建了一個路徑幷包含在info文件中。在我的源代碼中,我有我想要使用的路徑。但css文件未顯示在網絡中和清除的Drupal chache在perfomance.still CSS不included.What我要做的HTML源代碼中看到爲drupal 7中的IE瀏覽器添加css

的template.php

function phoenix_responsive_theme_preprocess_html(&$vars) { 
drupal_add_css(
drupal_get_path('theme', 'phoenix_responsive_theme') . '/css/ie_style.css', 
array(
    'group' => CSS_THEME, 
    'browsers' => array(
    'IE' => TRUE, 
    '!IE' => FALSE, 
    ), 
    'weight' => 999, 
    'every_page' => TRUE, 
) 
); 
} 
function phoenix_responsive_theme_preprocess_maintenance_page(&$vars) { 
// Add conditional stylesheets for IE. 
drupal_add_css(drupal_get_path('theme', 'phoenix_responsive_theme') . '/css/ie_style.css', 
array(
    'group' => CSS_THEME, 
    'browsers' => array(
    'IE' => TRUE, 
    '!IE' => FALSE, 
), 
    'weight' => 999, 
    'every_page' => TRUE, 
) 
); 
} 

路徑

<!--[if IE]> 
<style type="text/css" media="all"> 
@import url("http://localhost/test/themes/phoenix_responsive_theme/css/ie_style.css?osct7n"); 

+0

添加標籤'php'的問題。這是_php drupal_話題的問題。 – dsb

回答

0

試試這個。

參考:Adding browser-specific style sheets

function yourthemename_preprocess_html(&$vars) { 
    drupal_add_css(
    path_to_theme() . '/fix-ie.css', 
    array('weight' => CSS_THEME, 
      'browsers' => array('IE' => 'lt IE 7', '!IE' => FALSE), 
      'preprocess' => FALSE 
    )); 
    }