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 Build a Simple Website Text Editors and HTML Creating Structure

Eliot Murton
Eliot Murton
7,315 Points

Anchor is spreading more than I want! Why?

I want the phrase "Avocado Chocolate cupcake" to be the only thing showing as underlined and anchored but for some reason this is applied to "This weeks featured cupcake is the Avocado Chocolate cupcake". I cannot figure out why. I have copied the instructions and code.

'''

<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset-8"/> <title>Smells Like Bakin' Cupcake Company</title> </head> <body> <img src="img/logo.gif" alt="Smells Like Bakin"> <ul class="nav"> <li><a href="#">About</a></li> <li><a href="#">Cupcakes & Prices</a></li> <li><a href="#">Locations</a></li> <li class="last"><a href="#">Contact Us</a></li>
</ul> <div id="intro"> <h1>Opposites really do attract, especially in our kitchen. We combine unexpected flavours that melt together to create ironically delicious deserts.</h1> <p><a href="£" class="btn">Browse Our Cupcakes></p> </div> <img src="img/you-bake-me-blush.gif" alt="You Bake Me Blush">

    <div id="featured-cupcake">
        <h2>Cupcake of the Week</h2>
        <p>This weeks featured cupcake is the <a href="#">Avocado Chocolate cupcake</a>. Its strange combo of flavours will kick your taste buds into fiesta mode!</p>
        <img src="img/featured-cupcake.jpg" alt="Avocardo Chocolate Cupcake">
    </div>

</body>

</html>

'''

3 Answers

Stone Preston
Stone Preston
42,016 Points

it looks like you did not close an anchor tag

div id="intro">
            <h1>Opposites really do attract, especially in our kitchen. We combine unexpected flavours that melt together to create ironically delicious deserts.</h1>
            <p><a href="£" class="btn">Browse Our Cupcakes></p>
        </div>
        <img src="img/you-bake-me-blush.gif" alt="You Bake Me Blush">

        <div id="featured-cupcake">
            <h2>Cupcake of the Week</h2>
            <p>This weeks featured cupcake is the <a href="#">Avocado Chocolate cupcake</a>. Its strange combo of flavours will kick your taste buds into fiesta mode!</p>
            <img src="img/featured-cupcake.jpg" alt="Avocardo Chocolate Cupcake">
        </div>

this tag here

<p><a href="£" class="btn">Browse Our Cupcakes></p>

is not closed. try this

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset-8"/>
    <title>Smells Like Bakin' Cupcake Company</title>
</head> 
    <body>
        <img src="img/logo.gif" alt="Smells Like Bakin">
        <ul class="nav">
            <li><a href="#">About</a></li>
            <li><a href="#">Cupcakes & Prices</a></li>
            <li><a href="#">Locations</a></li>
            <li class="last"><a href="#">Contact Us</a></li>    
        </ul>
        <div id="intro">
            <h1>Opposites really do attract, especially in our kitchen. We combine unexpected flavours that melt together to create ironically delicious deserts.</h1>
            <p><a href="£" class="btn">Browse Our Cupcakes></a></p>
        </div>
        <img src="img/you-bake-me-blush.gif" alt="You Bake Me Blush">

        <div id="featured-cupcake">
            <h2>Cupcake of the Week</h2>
            <p>This weeks featured cupcake is the <a href="#">Avocado Chocolate cupcake</a>. Its strange combo of flavours will kick your taste buds into fiesta mode!</p>
            <img src="img/featured-cupcake.jpg" alt="Avocardo Chocolate Cupcake">
        </div>

    </body>
</html>

damn Stone, you beat me to it :( lol

Eliot,

I have looked through the code in the box and it seems valid, the only thing that I would make sure you check is make sure you go thru and check that all previous link tags have been closed, in the example there is one just above this <div>.

Cheers

Scott

Eliot Murton
Eliot Murton
7,315 Points

Thanks for that. It is so obvious now you have shown me.