how to apply conditional stylesheet $this->headLink()->appendStylesheet('css/css.css') with zend-framework

10,640

Solution 1

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

Solution 2

Is this what you mean

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

The section with IE 6 in, can be any expression used for including IE specific stylesheets

Hope that helps.

Share:
10,640

Related videos on Youtube

Santosh Linkha
Author by

Santosh Linkha

click here to edit

Updated on April 02, 2020

Comments

  • Santosh Linkha
    Santosh Linkha about 4 years

    can anyone help me with what to do for css for IE (for blueprint css)

    I have done

    <?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;
    ?>
    

    and this code didn't work either

    <?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;
    ?>
    

    UPDATES::

    it shoudl look like

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

Related