问题描述
<body style="background-color: paleturquoise">
<h2 style="color: red">Duke's soccer League: Home Page<br/></h2>
<ul style="list-style-type: circle">
<li style="font-size: larger"><a href="league_list.in">All Leagues list</a></li>
<li style="font-size: larger">Register for a League (TBA)<br/><br/></li>
</ul>
<h2 style="color: red">League Administrator</h2>
<ul style="list-style-type: square">
<li style="font-size: larger"><a href="add_league.in">Add a new League (TBA)</a></li>
<img src="C:\Users\VIRK\Desktop\66.jpg" width="400" height="400" ></img>
</ul>
</body>
目前我正在使用JSP进行练习,并尝试使用此代码在NetBeans IDE 7.0上创建网页但是当我构建并运行代码页时没有错误,但图像未显示在浏览器中。
I am currently practice with JSP and I try this html code to make a web page on NetBeans IDE 7.0 but when I'm build and run the page no error in code but the image is not showing in the browser.
已编辑:
在这里,我给出了NetBeans IDE的屏幕截图,您可以在其中看到图像存在于Web-INF文件夹和index.jsp页面中,并且我尝试使用/
在图像名称之前,但它不起作用。我的项目的确切路径是C:\ Users \VIRK\Documents\NetBeansProjects\practiceJSP。
Here I have given the screenshot of the NetBeans IDE where you can see the image is existing in Web-INF folder and the index.jsp page too and I tried with "/"
before the image name but it won't work. The exact path of my project is C:\Users\VIRK\Documents\NetBeansProjects\practiceJSP .
<img src="/66.jpg" width="400" height="400" ></img>
推荐答案
我找出如何设置图像路径只需在目标文件夹之前将/
删除为images / 66.jpg
不是/ images / 66.jpg
它对我来说工作得很好。
I find out the way how to set the image path just remove the "/"
before the destination folder as "images/66.jpg"
not "/images/66.jpg"
And its working fine for me.
这篇关于图像没有在浏览器中显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!