【问题标题】:Cakephp: Loading background-image cssCakephp:加载背景图像 css
【发布时间】:2014-06-12 10:27:12
【问题描述】:

我没有在我的页面上加载背景图片。它在“app/webroot/img/background.png”内

style.css - 它的工作.. 我只是无法加载我的图像

.layout{
    width: 100%;
    height: 230px;  
    position: relative;
    margin: auto;
    background-image:('../img/background.png');
}

.layout-image{
    width: 940px;
    height: 230px;
    position: relative;
    margin: auto;
}

index.php

<div class="layout">
      <div class="layout-image">
          <img src="img/layout.png" alt="">
      </div>
    </div>

webroot/.htacces

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>

【问题讨论】:

    标签: php css html cakephp mod-rewrite


    【解决方案1】:

    对不起,我的愚蠢错误,错过了网址

    background-image: url('../img/background.png');
    

    【讨论】:

      猜你喜欢
      • 2014-02-17
      • 2011-11-03
      • 1970-01-01
      • 1970-01-01
      • 2017-05-01
      • 1970-01-01
      • 2014-06-05
      • 2021-11-07
      相关资源
      最近更新 更多