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
Tamsin Waters
6,116 Pointsimage not enlarging
trying to add images for preparing gallery - and image should enlarge (open on to new page) when clicked - but instead when clicked on image downloads - Can anyone tell me why - Please & Thank you!
<li> <a href="img/sherril02.jpg"> <img src="img/sherril02.jpg" alt=""> <p>This is Sherril.co.uk before my work</p> </a> </li>
Jacob Miller
12,466 PointsCan you link to a codepen with your code?
10 Answers
Tamsin Waters
6,116 PointsJacob Miller
12,466 PointsThat link isn't working for me. I'm not sure if workspaces can be linked to.
Tamsin Waters
6,116 PointsSorry i don't use the code pen I have a text editor - and it's been a really long day trying to figure little fiddily bits out!
I think i've managed to find away to type a bit of the code on here
' test <li>
<a href="img/summer.JPG">
<img src="img/summer.JPG" alt="">
<p>Summer Album</p>
</a>
</li> '
Jacob Miller
12,466 PointsIf you look at the link below that says "Markdown Cheatsheet" it tells you how to post code. You can either add three backticks (the other symbol on the "~" key) before and after your code, or indent each line with four spaces.
Tamsin Waters
6,116 Points``` <!-- img-----------------------------------------------------> <section> <ul> <li> <a href="img/autumn.JPG"> <img src="img/autumn.JPG" alt=""> <p>Autumn Album</p> </a> </li>
<li>
<a href="img/butterfly.JPG">
<img src="img/butterfly.JPG" alt="">
<p>Butterfly Album</p>
</a>
</li>
<li>
<a href="img/photo-of-the-day.JPG">
<img src="img/photo-of-the-day.JPG" alt="">
<p>Photo of the Day Album</p>
</a>
</li>
<li>
<a href="img/spring.JPG">
<img src="img/spring.JPG" alt="">
<p>Spring Album</p>
</a>
</li>
<li>
<a href="img/summer.JPG">
<img src="img/summer.JPG" alt="">
<p>Summer Album</p>
</a>
</li>
<li>
<a href="img/sun-and-moon.JPG">
<img src="img/sun-and-moon.JPG" alt="">
<p>Sun & Moon Album</p>
</a>
</li>
<li>
<a href="img/winter.JPG">
<img src="img/winter.JPG" alt="">
<p>Winter Album</p>
</a>
</li>
</ul>
</section> ```
Tamsin Waters
6,116 PointsOkay thanks - got code on - looks like it cut off the top there but heyho you'll get the idea! now back to my original question: trying to add images for preparing gallery - and image should enlarge (open on to new page) when clicked - but instead when clicked on image downloads - Can anyone tell me why - Please & Thank you!
Tamsin Waters
6,116 PointsOkay thanks - got code on :) now back to my original question: trying to add images for preparing gallery - and image should enlarge (open on to new page) when clicked - but instead when clicked on image downloads - Can anyone tell me why - Please & Thank you!
Tamsin Waters
6,116 PointsOkay thanks - got code on :) now back to my original question: trying to add images for preparing gallery - and image should enlarge (open on to new page) when clicked - but instead when clicked on image downloads - Can anyone tell me why - Please & Thank you!
Jacob Miller
12,466 PointsTo open you photos in a new tab, you can add target="_blank" to you anchor elements, just after the href. So for example <a href="img/butterfly.JPG" target="_blank"> would open that link in a new tab. Is this what you wanted?
Tamsin Waters
6,116 PointsYes that would be ideal - or even if it open in same page - have tried your suggestion:
<a href="img/butterfly.JPG" target="_blank">
<img src="img/butterfly.JPG" alt="">
<p>Butterfly Album</p>
</a>
</li> ```
However it still jsut dowloads when clicking on pic :(
Tamsin Waters
6,116 PointsTamsin Waters
6,116 Pointsand it won't let me paste code on to here
:(