Image is not showing in browser?

前端 未结 12 1993
一整个雨季
一整个雨季 2020-12-17 03:42

    

Duke\'s soccer League: Home Page

相关标签:
12条回答
  • 2020-12-17 04:36

    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.

    0 讨论(0)
  • 2020-12-17 04:36

    I also had a similar problem and tried all of the above but nothing worked. And then I noticed that the image was loading fine for one file and not for another. The reason was: My image was named image.jpg and a page named about.html could not load it while login.html could. This was because image.jpg was below about and above login. So I guess login.html could refer to the image and about.html couldn't find it. I renamed about.html to zabout.html and re-renamed it back. Worked. Same may be the case for images enclosed in folders.

    0 讨论(0)
  • 2020-12-17 04:41

    You put inside img tag physical path you your image. Instead of that you should put virtual path (according to root of web application) to your image. This value depends on location of your image and your html page.

    for example if you have:

    /yourDir
    -page.html
    -66.jpg
    

    in your page.html it should be something like that:

    <img  src="66.jpg" width="400" height="400" ></img>
    

    second scenario:

    /images
    -66.jpg
    /html
    page.html
    

    So your img should look like:

    <img  src="../images/66.jpg" width="400" height="400" ></img>
    
    0 讨论(0)
  • 2020-12-17 04:41

    all you need to do is right click on the jsp page in the browser, which might look like "localhost:8080/images.jpg, copy this and paste it where the image is getting generated

    0 讨论(0)
  • 2020-12-17 04:42

    the easy way to do it to place the image in Web Content and then right click on it and then open it by your eclipse or net beans web Browser it will show the page where you can see the URL which is the exact path then copy the URL and place it on src=" paste URL " ;

    0 讨论(0)
  • 2020-12-17 04:43

    Your path should be like this : "http://websitedomain//folderpath/66.jpg">

    <img  src="http://websitedomain/folderpath/66.jpg" width="400" height="400" ></img>
    
    0 讨论(0)
提交回复
热议问题