FAQ: Learn HTML - Common HTML Elements - Linking to Other Web Pages

Other FAQs

The following are links to additional questions that our community has asked about this exercise:

  • This list will contain other frequently asked questions that aren’t quite as popular as the ones above.
  • Currently there have not been enough questions asked and answered about this exercise to populate this FAQ section.
  • This FAQ is built and maintained by you, the Codecademy community – help yourself and other learners like you by contributing!

Not seeing your question? It may still have been asked before – try searching for it by clicking the spyglass icon (search) in the top-right of this page. Still can’t find it? Ask it below by hitting the reply button below this post (reply).

how does adding learn more to an anchor element make the whole thing a hyperlink. i thought it was supposed to be just the anchor element and the href attribute

the text between the anchor opening tag and anchor closing tag is the text a user on your website can click on, the moment a user does this, they will be redirected to the route specified at href.

Is it possible to create a link and not make it look blue?? It looks bad sometimes.

yea, we can use css to style anchor elements. That is perfectly possible

1 Like

16 posts were split to a new topic: Old Bug questions for HTML Links

What’s the difference between “src” and “href”?

2 Likes

Great guide for mine. Very useful for SEO.

Hey, I’m starting coding now and I am currently on the linking exercise. Codecademy makes it seem like we can only link articles with HTML code, Is this true or false?

Hi,

Welcome to the forums and Good Luck on your learning journey :green_heart:

No you can link anything; from a page in the same directory (folder), to other websites, anything that has a link. As you go along you will learn and use more practical examples.

Two questions
firstly can we use src attribute in place of href(i know we can’t, but i’m curious as to the details seeing as they are not too different).
secondly when they were describing href they said “the paths are often URLs”, what else can be anchored with href apart from URLs.

html has a lot of underlying code, so its not as simple as it seems on the surface

we can use ids like so:

<a href="#first">jump</a>

to jump to a element with id first on the same page

2 Likes

I have a question. Can we use the href attribute for images that would lead to sites. And if yes, can you please show me an example of how it would look like?

then you would have to wrap the image in anchor tags (<a>)

It refused to accept my input of Learn More. and when I finally gave up (after reading forum and looking at hints) the solution had the url in it – step one specifically says “don’t enter url ”…

2 Likes

im stuck in here, can some one help ? thanks

2 Likes

I dont know if people still have that problem but you put “Learn More.” inside the anchor tags, instead of “Learn More”.
The period “.” is faulty. Try just copying the text out of the grey boxes into the code and you should be fine :slight_smile:

5 Likes

What is the difference between the href and src attributes?

  • img src
  • link href
  • a href
  • etc.

href is a hyperlink reference. where as src is source

HTML is a markup language, so under the hood, a lot is happening. I wouldn’t worry too much about why different elements have different attributes.

Just looking at it from my basic perspective, it seems like should have a source instead of a href attribute, since it binds/sources a file much like does.