Forum guidelines
  • Home
  • »
  • HTML 5
  • »
  • Problem displaying jpeg image in html5
AuthorQuestion
Problem displaying jpeg image in html5
Posted on: 16 Apr 2013
Hi friends,

Hope all are fine.
This code below is in notepad
My code is as below and i am not able to display JPEG image the file and the image are in same folder
<html>
<body>

<img src="Photo2095.jpeg" alt="my pic"/>
</body>

</html>


B M S
AuthorReply
Re: Problem displaying jpeg image in html5
Posted on: 16 Apr 2013  
the image will be displayed if it is in the same folder, check the following:

1. Image name is correct including the extension as mentioned in the html.
2. The image location is correct in the html, check the image exist at the same location where you HTML file is, other change the code to src="folder\imagename.jpg"

Re: Problem displaying jpeg image in html5
Posted on: 16 Apr 2013  
Javeed,

I have the image and the html file in the web folder in E drive.. Since image is in same folder i did not mention full path..

B M S
Re: Problem displaying jpeg image in html5
Posted on: 16 Apr 2013  
Suchitra,

I tried your code and changed the image name to the one i have and browse the page in IE, the output showed me the image, so i am sure that the image name you are passing is incorrect are you sure it is .jpeg and not .jpg

Re: Problem displaying jpeg image in html5
Posted on: 16 Apr 2013  
Yes Javeed,

Its a .jpeg image. But not getting displayed in IE nor mozilla nor chrome. The file name is correct and i hope my code above is correct...
Please help i am still stuck

B M S
Re: Problem displaying jpeg image in html5
Posted on: 19 Apr 2013  
please send me the image
Re: Problem displaying jpeg image in html5
Posted on: 19 Apr 2013  
photo2095.rar Hi Javeed,

Please find the image attached..

B M S
Re: Problem displaying jpeg image in html5
Posted on: 20 Apr 2013  
ok try this code:

<html>

<body>

<img src="Photo2095.jpg" alt="my pic"/>
</body>

</html>


Re: Problem displaying jpeg image in html5
Posted on: 20 Apr 2013  
files.rar If the image and file are in same folder works fine.. But when i shift the image or refer to image in another folder should i use forward or backward slash.. in many sites i see forward slash.. What is the difference between the two?

The image does not get displayed in mozilla at all.. Please have a look at the code given below along with files attached.. Where am i going wrong?

<!DOCTYPE html>
<html>
<head>
<title>Display Images</title>
</head>
<body>
<p>
<img src="Photo2095.jpg" alt="image"/>
</p>
<p><img src="C:/Documents and Settings/Shrinivas/My Documents/My Pictures/Sample Pictures/Sunset.jpg" width="300" height="300" alt="IMG"/></p>
</body>
</html>



B M S

SPONSORED BY

Custom Software Development
MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.