Question about link urls


#1

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> "www.facebook.com" </a>

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

<a href="www.facebook.com"/>

What is the difference?


#2

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="https://facebook.com">facebook</a>

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


#3

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

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


#4

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


#5

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!

Screenshot: https://postimg.org/image/709m073kn/


#8

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


#9

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