如何使用zend-framework应用条件样式表$ this-> headLink() - > appendStylesheet('css / css.css')

时间:2011-01-17 09:11:20

标签: zend-framework blueprint-css

任何人都可以帮我搞清楚IE的css(蓝图css)

我已经完成了

<?php $headlink = $this->headLink();        
    $headlink->appendStylesheet($this->baseUrl('css/blueprint/screen.css') , 'screen, projection')
        ->appendStylesheet($this->baseUrl('css/blueprint/ie.css'), 'screen, projection', "IE")
        ->appendStylesheet($this->baseUrl('css/blueprint/print.css'));
    echo $headlink;
?>

并且此代码无效

<?php $headlink = $this->headLink();        
    $headlink->appendStylesheet($this->baseUrl('css/blueprint/screen.css') , 'screen, projection')
        ->appendStylesheet($this->baseUrl('css/blueprint/ie.css'), 'screen, projection', true)
        ->appendStylesheet($this->baseUrl('css/blueprint/print.css'));
    echo $headlink;
?>

更新::

它看起来像是

<!--[if lt IE 8]><link rel="stylesheet" href="css/blueprint/ie.css" type="text/css" media="screen, projection"><![endif]-->

2 个答案:

答案 0 :(得分:20)

$this->view->headLink()->appendStylesheet('/css/ie.css', 'screen', 'IE');
$this->view->headLink()->appendStylesheet('/css/ie6.css', 'screen', 'IE6'); 

答案 1 :(得分:5)

这就是你的意思

->appendStylesheet($this->baseUrl('/css/ie6.css'), "screen", 'IE 6')

IE 6 in的部分可以是用于包含IE特定样式表的任何表达式

希望有所帮助。