【发布时间】:2015-11-28 07:33:37
【问题描述】:
我有这个 div,它正在从互联网加载完美的图像 url,但不是我的本地图像,非常奇怪:
<div class="col biggest-grid dir-medico-grid" ng-click="showDirMedico()">
<img src="../img/dirmedico.png" class="img"/>
<p>DIRECTORIO MÉDICO</p>
</div>
所以当我尝试这个时它没有问题:
.dir-medico-grid{
background: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/652/confectionary.png);
}
但如果我试试这个:
.dir-medico-grid{
background: url(../www/img/doctors.jpg);
}
现在它不起作用,因为你可以确保我的路径是正确的,我将从 ionic.app.scss 转到 doctors.jpg:
我尝试过使用background: url(../www/img/doctors.jpg) no-repeat center center fixed;,使用'../www/img/doctors.jpg' 和"../www/img/doctors.jpg",使用background-image而不是background,但似乎没有任何效果,这很奇怪。
【问题讨论】:
-
在本地机器上使用图片的完整路径只是为了测试。让我们知道结果。
-
试试
background: url('/www/img/doctors.jpg');css-tricks.com/quick-reminder-about-file-paths -
@chrisbedoya 没用,但它有效
background: url('../img/doctors.jpg');我很困惑!
标签: html css ionic-framework ionic ionic-view