【问题标题】:zf2 do not recognize the CSS library?zf2 不识别 CSS 库?
【发布时间】:2015-04-20 14:39:38
【问题描述】:

为什么我的 zf2 不能识别 css 库?

Firefox 控制台向我显示:

GET http://localhost/pandramon/public/css/css/animate.css [HTTP/1.1 404 Not Found 229ms] 获取http://localhost/pandramon/public/css/css/font-awesome.min.css

我的代码:

<!-- Le styles -->
<?php echo $this->headLink(array('rel' => 'shortcut icon', 'type' => 'image/vnd.microsoft.icon', 'href' => $this->basePath() . '/img/favicon.ico'))
                ->prependStylesheet($this->basePath('css/animate.css'))
                ->prependStylesheet($this->basePath('css/font-awesome.min.css'))
                ->prependStylesheet($this->basePath('css/style.css'))
                ->prependStylesheet($this->basePath('css/bootstrap-theme.min.css'))
                 ->prependStylesheet($this->basePath('css/bootstrap.min.css'))
?>

【问题讨论】:

  • 在路径中的 css 之前添加 /,如下所示:-&gt;prependStylesheet($this-&gt;basePath('/css/animate.css'))

标签: css zend-framework2


【解决方案1】:
 <?php 
    echo $this->headLink(
        array(
            'rel' => 'shortcut icon', 
            'type' => 'image/vnd.microsoft.icon', 
            'href' => $this->basePath() . '/img/favicon.ico')
        )
        ->prependStylesheet($this->basePath() . '/css/bootstrap-responsive.min.css');

 ?>

【讨论】:

  • 请在您对 OP 的回答中添加一些描述;)。
猜你喜欢
  • 2023-04-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-06-24
  • 1970-01-01
  • 1970-01-01
  • 2010-10-03
相关资源
最近更新 更多