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

image 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>

and it won't let me paste code on to here

:(

Can you link to a codepen with your code?

10 Answers

That link isn't working for me. I'm not sure if workspaces can be linked to.

Sorry 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> '

If 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.

``` <!-- 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> ```

Okay 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!

Okay 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!

Okay 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!

To 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?

Yes 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 :(