简体   繁体   English

即使它们位于同一文件夹中,我的图像也不会加载到我的模态框中

[英]My Image is not loading in my Modal box even though they are in the same folder

I want an image inside my modal box. 我希望在模态框内有一个图像。 I am using CodeIgniter and the image is located in the same folder as my modal box's page. 我正在使用CodeIgniter,并且图像与模式框页面位于同一文件夹中。

This is my modal code 这是我的模态代码

            <div class="modal fade" id="modalWin" tabindex="-1" data-backdrop="false">
              <div class="modal-dialog modal-dialog-centered">
                <div class="modal-content">
                  <div class="modal-header">
                    <h5 class="modal-title" id="winnerDraw">Drawing Winner</h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                      <span aria-hidden="true">&times;</span>
                    </button>
                  </div>
                  <div class="modal-body">
                    <img src="C:\xampp\htdocs\raffle1\application\views\webRaffle.png" height="200px" width="450px">
                    <p>{winner name}</p>

                  </div>
                </div>
              </div>
            </div>

And I already have the necessary boostrap headers as well as script headers. 而且我已经有了必要的boostrap标头和脚本标头。

The img.src is pointing at your C drive. img.src指向您的C驱动器。

You can use a relative url, say src="webRaffle.png" . 您可以使用相对网址,例如src="webRaffle.png"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 即使我的第一个ID不属于该ID,我也会得到相同的文本 - I get the same text my first id in all my tooltips, even though it doesn't belong to that id 为什么我的输入元素消失了,即使它出现时的代码是一样的? - Why does my input element disappear, even though the code is the same when it does appear? 我的一条路线的参考错误,即使它与其他路线完全相同 - Reference Error with one of my routes, even though it's the exact same as the others 为什么在 Postman 中我的帖子请求可以工作,但即使我也在做同样的事情,但在浏览器中却不行? - How come in Postman my post request works but not in the browser even though I'm doing the same? 为什么我的图片没有加载? - Why is my image not loading? 为什么我的区间调用我的 function 即使它在一个变量中? - Why is my interval calling my function even though its in a variable? 即使我的 package.json 和 node_modules 文件夹中有它们,我也得到了未定义的包 - I'm getting undefined packages even though I have them in my package.json and node_modules folder 为什么我的文本不会在模态框上改变颜色? - Why will my text not change color on modal box? 如何用模态文本框填充我的文本框 - How to fill my textbox with the modal text box 在模态中显示图像,即使它是相同的图像 - Show image inside modal, Even if it's the same image
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM