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 trialjames freyre
526 PointsWhile building a website using HTML/CSS, images aren't appearing in the preview workspace. Only links. Any ideas why?
Btw, my code is exactly the same as in the video. I checked mutiple times. Also tried it on Chrome and Edge browsers.
This is my code so far btw. Thanks for all your help!
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>James Freyre Designer</title>
</head>
<body>
<header>
<a href="index.html">
<h1>James Freyre</h1>
<h2>Designer</h2>
<a/>
<nav>
<ul>
<li><a href="index.html">Portfolio</a></li>
<li><a href="About.html">About</a></li>
<li><a href="Contact.html">Contact</a></li>
</ul>
</nav>
</header>
<section>
<ul>
<li>
<a href="img/numbers-01.jpg" alt=""
<img src="img/numbers-01.jpg" alt="">
<p>Experimentation with color and texture.</p>
</a>
</li>
<li>
<a href="img/numbers-02.jpg" alt=""
<img src="img/numbers-02.jpg" alt="">
<p>Playing with blending modes in photoshop.</p>
</a>
</li>
<li>
<a href="img/numbers-06.jpg" alt=""
<img src="img/numbers-06.jpg" alt="">
<p>Trying to create 80's style of glows.</p>
</a>
</li>
<li>
<a href="img/numbers-09.jpg" alt=""
<img src="img/numbers-09.jpg" alt="">
<p>Drips created using photoshop brushes</p>
</a>
</li>
<li>
<a href="img/numbers-12.jpg" alt=""
<img src="img/numbers-12.jpg" alt="">
<p>Creating shapes using repetition.</p>
</a>
</li>
</ul>
</section>
<footer>
<p>©2017 James Freyre.</p>
</footer>
</body>
</html>
3 Answers
Rochell Hill
10,677 PointsYou left off the '>' after the alt="" portion of some of your code.
Example of your code: <li> <a href="img/numbers-12.jpg" alt="" <img src="img/numbers-12.jpg" alt=""> <p>Creating shapes using repetition.</p> </a> </li>
Try this: <li> <a href="img/numbers-12.jpg" alt=""> <img src="img/numbers-12.jpg" alt=""> <p>Creating shapes using repetition.</p> </a> </li>
Nancy Melucci
Courses Plus Student 36,143 PointsI can't tell from this code exactly what is going on. I remember that workspaces usually requires the images to be in the images file path. Where are your images? Can the file see them? Are you using the correct extensions?
I am just spitballing here. If this has nothing to do with the problem, I apologize. Good luck!
james freyre
526 PointsThanks so much everybody. In addition to what Rochell noticed, my folder containing the images was titled "images" and not "img." I corrected it and all is okay now. So the following code (marked img) couldn't detect where the images were located. <a href="img/numbers-02.jpg"> <img src="img/numbers-02.jpg" alt="">
Jonathan Grieve
Treehouse Moderator 91,253 PointsJonathan Grieve
Treehouse Moderator 91,253 PointsHi James, could you post the code you have for us? Maybe a second pair of eyes can help spot something! :-)