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

Jason Marlin
Jason Marlin
1,166 Points

Help! My image won't load in OS X but it will in Windows? Why!?!

So all I'm trying to do is get my image to load and display in the browser but it just won't. I'm using Mac OS X Yosemite. Reason I'm stating this is because the exact same markup that fails to load on my mac, works fine on my Windows laptop!

<img src=β€œUsers\jasonmarlin\Documents\logo.png” width="350" height="263" alt="Klematis">

I'm doing this exercise from w3 schools: https://www.w3schools.com/css/tryit.asp?filename=trycss_boxmodel_width

so that is my markup in its entirety.

so yeah i am trying to load the page locally from my MAC device and I just can't get the image to load. But when I try this same thing on my laptop I don't even need the path almost at all, it will load with just a simple: <img src="logo.png">

Perhaps i should state that I do swap out the "klematis.jpg" for "logo.png" So don't get hung up on that, but the markup should work work either way because the location is the same....its in the my documents folder on my device in both circumstances.

Kevin Gates
Kevin Gates
15,052 Points

Posting your code with the Markdown Cheatsheet so it is easier to read:

<img src=β€œUsers\jasonmarlin\Documents\logo.png” width="350" height="263" alt="Klematis">

2 Answers

Jason Marlin
Jason Marlin
1,166 Points

Is there some kind of syntax difference between OS X and Windows or between Chrome and Safari? I actually tried opening the page in chrome on the mac just now, still not working...

Kevin Gates
Kevin Gates
15,052 Points

The reason I'm presuming this isn't working is because you may be missing the file in your Mac environment in the actual file system. You're using backslashes, which means you're not looking to a web page, but a distinct file. That means your mac should have a Users\jasonmarlin\Documents\logo.png filepath. If it doesn't then nothing will show on your Mac.