Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML HTML Objects Images

Difference between jpeg and png

so I am trying to place a jpeg image on my html page. only it doesn't work. if I switch the file type to png,, it does work. Why doesn't jpeg img work on my cpu. Just so you know the filepath is correct.

1 Answer

Richmond Lauman
Richmond Lauman
28,793 Points

Hi Shayan.

Take a look at the file extension for the jpeg image. It could be .jpeg or .jpg. Did the file path you use match the extension exactly? It has to to work. I jnow you said the path was correct, but this is a case where many people think it is correct when it is not, thinking that they can use either extension interchangable. The extension in the path does have to match the extension on the file in order to work.

If that is not the problem, I have no idea why the jpeg image will not work for you.