Question about link urls

Hey guys and gals, I got a question regarding adding urls which I came across in designing a button for your web: 8.

Previously at the beginning of the HTML lessons, to insert a link it would be:

<a href> "" </a>

But in the design a button lesson, this code was wrong and the code that worked to pass the lesson was:

<a href=""/>

What is the difference?

well, neither should have passed either of the exercise.

a link exist of a opening tag with a href attribute, some text to click on and a closing tag:

<a href="">facebook</a>

href tells the link where to go (don’t forget http), then the text to user can click on to go there.

The first code worked in Basics 1 and I stuck with that. The code would just appear as in the window.

So links always must include a text after the url then?

okay, i put them all in a bin

See which one are working. (the target blank is to open the urls in a new tab)

Yea, you need text after the url, otherwise there is nothing to click on

There is something to click on, however the link just goes to codeacademy and doesn’t load which I just noticed, but it passed the test. I just went back to my previous lessons.

But thank you for the quick responses, I’ve edited my notes in my book about inserting urls correctly. Thank you!


yes, but if you actually right click on the link in the exercise and select open in new tab, the url won’t be opened.

Kind of annoying to have dead links on your site

Yeah, I went back through the lessons and none of them work haha. Thanks again for the correct tag for urls!