1

I am having few jpeg images on "C:/images/". I would like to slide show these images on a web page.I am using java code to get the right path of the image folder and jsp as front end having html div element to display the image. I have tried like this to display single image but failed, could anyone please help me out

  <div id="image" style="background-color:yellow;  height:200px; width:100px;float:left;">
  <img src="C:/Desktop/Images/Image1.jpg" style="height:200px; width:100px;floatleft;">

11
  • Show some code and a description of your error. Commented Oct 29, 2013 at 7:57
  • Post your code that you've tried so far pls Commented Oct 29, 2013 at 7:58
  • You have a typo here float:left; You forgot the : .Have you tried to use the path relative to the path of the html document? Commented Oct 29, 2013 at 7:59
  • You said two different things, first "C:/images/" then in your code "C:/Desktop/Images/". You sure you just didn't look in the wrong place? (remember it is case sensitive) Commented Oct 29, 2013 at 8:02
  • @Ruddy tried C:/Desktop/Images/Image1.jpg" is correct, but still fails to display Commented Oct 29, 2013 at 8:05

3 Answers 3

2

Same question in this post: Why can't I do <img src="C:/localfile.jpg">?

but you can use "../" to locate the correct path. http://www.pagetutor.com/html_tutor/missing.html

But why you don't want to make a folder on your on application. It is more easier than access it on your desktop, etc.

Sign up to request clarification or add additional context in comments.

Comments

0

Why not just move the image to your root folder and link it?
If you need it in the C:/ folder, try doing what Newbie said, and use ../ to find the correct path.

Comments

0

You can try this out, simpler solution to generate a html file automatically which will include all the images under specific folder https://stackoverflow.com/a/55633983/7786118

1 Comment

This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.