使用drupal_add_css()函数可以将其它的样式表添加到样式表数组中去:
<?php
// Repeat this line for every CSS file added.
drupal_add_css(path_to_theme() . '/example.css', 'theme', 'all', TRUE);
// Reassemble the $styles snippet to include the new files.
$styles = drupal_get_css();
?>
在这个例子中,我们是从主题文件夹下取得的example.css文件.当然你也可以把样式表放到files目录下,这样就不用使用path_to_theme()函数了,此时你就可以直接这样用'files/subdirectory/example.css'.
drupal_add_css()函数的参数分析:
对于Drupal 4.7.x
<?php
print $head;
print theme('stylesheet_import', base_path() . path_to_theme() . '/your_extra.css');
print $styles;
?>
因此,这就是样式表的最终顺序:
样式表可以对前面的CSS规则进行覆写(例如,style.css可以覆写它前面的所有的CSS,除了用户CSS)。