gpt4 book ai didi

html - 我的图片不会使用背景 url 出来

转载 作者:行者123 更新时间:2023-11-28 04:55:41 24 4
gpt4 key购买 nike

我是 code igniter 的初学者,我将图片的位置保存在数据库中。在这里,我想在 div 中使用背景 url 将其显示回来。我的问题是它不出来,当我复制位置并将其粘贴到浏览器中时,图片就出来了。

我推荐:<div class="patient-pic" style="background-image: url([::1]/clinic/asset/uploaded_images/togoru.jpg)"></div>

这是我的代码:

<div class="col-sm-10">
<div class="panel-group">
<div class="panel panel-info">
<div class="panel-heading">
<h4><a data-toggle="collapse" href="#patientinfo">#1 Taguro <span class="fa fa-arrow-circle-o-down pull-right"></span></a></h4>
</div>
<!-- panel-heading -->
<div id="patientinfo" class="panel-collapse collapse">
<div class="panel-body">
<div class="row">
<div class="col-sm-4">
<button class="btn btn-success btn-sm">Check me up</button>
</div>
<!-- col-sm-4 -->
<div class="col-sm-6">
<div class="img-patient">
<div class="patient-pic" style="background-image: url([::1]/clinic/asset/uploaded_images/togoru.jpg)"></div>
</div>
<!-- img-patient -->
</div>
<!-- col-sm-6 -->
</div>
<!-- row -->
</div>
<!-- panel-body -->
</div>
<!-- panel-collapse -->
</div>
<!-- panel -->
</div>
<!-- panel-group -->
</div>
<!-- col-sm-10 -->
</div>
<!-- queue -->

</div>
<!-- col-title -->
</div>
</div>
<!-- row -->

这是我的CSS:

.img-patient {
display: block;
width: 100%;
overflow: hidden;
text-align: center;
}
.patient-pic {
width: 100px;
height: 100px;
overflow: hidden;
text-align: center;
border-radius: 50%;
margin: 20px auto;
background-position: center center;
background-repeat: no-repeat;
background-size: cover;
}

最佳答案

我认为这是错误的网址。我尝试在谷歌开发者工具上进行调试。它工作正常。

enter image description here

关于html - 我的图片不会使用背景 url 出来,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40418691/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com