Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS

Dan Sinclair
Dan Sinclair
1,420 Points

Help with CSS arrow links not linking

I'm sure it's something very simple I'm not seeing, but I can't seem to get my css arrows to actually be a clickable link.

I got it to work, but can't seem to figure out why it's not working at it's current state.

 <div>
         <a href="Sawtooth-Initiative.html" id="left-arrow" class="previous" rel=""><a/>
      </div>

      <div>
         <a href="Bling-Ring-Shoes.html" id="right-arrow" class="next" rel=""><a/>
      </div>
#right-arrow {

    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-left: 10px solid #32cd32;
    border-bottom: 10px solid transparent;
}

#left-arrow {
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-right: 10px solid #32cd32;
    border-bottom: 10px solid transparent;
    max-width: 100%;
}

.previous {
  position:fixed;
  bottom:10%;
  left:5%;
}


.next{
  position:fixed;
  bottom:10%;
  right:5%;
}

2 Answers

There isn't anything in between your links to be clicked on.

<div>
         <a href="Sawtooth-Initiative.html" id="left-arrow" class="previous" rel="">Nothing here<a/>
      </div>

      <div>
         <a href="Bling-Ring-Shoes.html" id="right-arrow" class="next" rel="">Nothing here<a/>
      </div>
Colin Bell
Colin Bell
29,679 Points

That shouldn't matter though since he's setting it up as a shape.

It works here, and I just copied and pasted his code: jsbin

Dan Sinclair
Dan Sinclair
1,420 Points

I wanted to use the triangles created with CSS, and use those as the clickable reference. When I place the triangle id between the link, nothing works.

Dan Sinclair
Dan Sinclair
1,420 Points

Thank you both for your help on this! Colin, I'll try the code you referenced in your comment.

I didn't notice he was just setting it up as a shape, but I think the problem is that he's using position "fixed". I know it works in the jsbin but depending on the context in which he's using it, the outcome could be completely different.

Dan Sinclair
Dan Sinclair
1,420 Points

Thanks David! I'll check into that as well!

Colin Bell
Colin Bell
29,679 Points

Just realized: Your closing link tag has the slash transposed.

<a href="Sawtooth-Initiative.html" id="left-arrow" class="previous" rel=""><a/>
                                                                       <!-- ^ Here -->
<a href="Bling-Ring-Shoes.html" id="right-arrow" class="next" rel=""><a/>
                                                                 <!-- ^ Here -->

Should be

<a href="Sawtooth-Initiative.html" id="left-arrow" class="previous" rel=""></a>
                                                                       <!-- ^ Here -->
<a href="Bling-Ring-Shoes.html" id="right-arrow" class="next" rel=""></a>
                                                                 <!-- ^ Here -->
Dan Sinclair
Dan Sinclair
1,420 Points

I see! Thanks Colin. I went ahead and made those changes. For some reason it's still not linking. I'll keep at it.