【问题标题】:Twitter Bootstrap Background image not showing on localhostTwitter Bootstrap 背景图像未显示在本地主机上
【发布时间】:2016-04-09 13:47:15
【问题描述】:

我正在 ubuntu linux 上的 localhost(xampp) 上开发 twitter bootstrap,我已经尝试了很多方法来加载网站的背景图片,但似乎没有任何效果。我将图片放在与我的php文件。我已经包含了所有的引导cdn,但它不起作用。是url问题吗?

这里是 JSbin 上的代码链接http://jsbin.com/nudemorune/edit?html 提前谢谢...!!!

【问题讨论】:

  • 修正图片的url
  • 不要将常规文本格式化为代码,以欺骗指向 fiddle/bin 站点的链接必须附有实际代码的要求。

标签: javascript html css twitter-bootstrap cdn


【解决方案1】:

不显示背景图片的原因可能是 CSS 没有获取图片。我的意思是你的背景图片路径不正确。尝试这样做:

#topcontainer{

            background-image:url("../img-directory-name/background.jpg");
            height:400px;
}

【讨论】:

  • 我试图放入该位置,但它仍然无法正常工作,图像位于 var/www/html/tempboot ....即 tempboot 是我的实际 php 所在的目录以及同一位置的图像。可能是什么问题
  • 你能提供我你的项目层次结构吗?您的 CSS 文件的位置?
  • 我已经上传了我的服务器文件的截图
  • #topcontainer{ background-image:url("../background.jpg"); height:400px; }
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2018-09-21
  • 1970-01-01
  • 1970-01-01
  • 2019-09-04
  • 2015-07-02
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多