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

JavaScript

Johnny Ariza
seal-mask
.a{fill-rule:evenodd;}techdegree
Johnny Ariza
Front End Web Development Techdegree Student 11,525 Points

When you click the link on the page that direct you where you already are it goes blank.

I saw a few students having the same problem and they came up with different methods to solve this. Such as: a:not([href=#]) and disable the links.

which would be the most appropriated solution?

1 Answer

Steven Parker
Steven Parker
229,644 Points

Anything effective could probably be considered "appropriate".

My favorite solution is possibly the most popular one, which is to modify the HTML so that the item representing the current page is no longer a link at all. That way nothing will happen if it is clicked on, and the functionality will be immediately obvious to anyone reading the HTML even if they are not familiar with the CSS.

I previously suggested this and gave an example in my answer to this other question.