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
Matthew Jones
999 PointsBroken Image in Workspaces
I am having a trouble with broken images in my HTML. I am on a bootstrap build. My file tree and my html is within this URL. Please help http://www.screencast.com/users/mjjply12/folders/Default/media/9e94721c-ec35-428c-a053-14f181b6191e
3 Answers
Phil Pickering
1,343 PointsUsing parentheses in URIs can produce unexpected results. Best to not use them at all. Same with spaces in filenames.
Also, you really should use a more semantic name than just "image" anyway and you should include the alt attribute.
So, rename your image to something like "sunset.jpg" and then use the following HTML to link to it:
<img src="img/sunset.jpg" alt="Photo of sunset">
Anas Mourad
14,922 PointsHey Matthew, I see some extra spaces in image tag. Remove them and try again. You can call the image: "image.jpeg" instead so your code can be 'src="img/image.jpeg" '.
Matthew Jones
999 PointsHi Anas, I just tried using that format and that does not work either.
Gloria Dwomoh
13,116 PointsHi Matthew, I suggest you try src="/img/image(1).jpeg"
Matthew Jones
999 PointsHi Gloria, thank you for responsing. I have already tried that way and it does not work either.
Gloria Dwomoh
13,116 PointsOh okay, I didn't see it in the examples you gave.
Matthew Jones
999 PointsIt wasn't. I forgot to include that. It was my fault.
Matthew Jones
999 PointsMatthew Jones
999 PointsHi Phil, thank you for your comment, it worked! The change in the actual name of the file instead of the standard "image" fixed the issue. I love this website!