Need help with anchor element

I am new to the group and I have just started to try learning to code. I am a beginner. I am stuck on anchor element and need to know how would I anchor a text. I have tried and read up on everything i could think of to get some idea but much be something I am still doing wrong because I just can not get it . any help would be appreciated

Hello Ameerah, and welcome to Codecademy!

Could you give us more information?
Which exercise is it?
What did you try? Could we see an example?

Please provide a link to the exercise you’re currently stuck on.

1 Like

Im on the lesson Make a Website

I eventually had to give up and get the solution but I still would like to know why the answer was what it was and why was it put in that particular place , This is the part i havent been able to catch on to yet and I know this is important if i want to do omputer programming and web design

Ok no problem, let’s take it step by step, I’m sure there’s a logical reason as to why this didn’t work.

Do you remember what you tried? Could you show me?

But back to your original question – to anchor text, you’d do it like this:

<a href="">Example Anchor Text</a>

Now that we know that, the exercise wants you to:

  • Write <p>Here is a list of cities where you can find us.</p>
  • Add the anchor <p>Here is a <a href="cities.html">list</a> of cities where you can find us.</p>

Please note that the Codecademy environment is quite strict to determine if you gave a correct answer or not. You’ll need to concentrate and watch out for a few things. For example, say that you wrote this code correctly, but forgot to add the full-stop at the end of the sentence. Well, you might not pass the exercise. Try to carefully read each instruction, especially when you’re getting error warnings.

You’re just getting started so, don’t worry! In time, you’ll get used to this, and will learn to find your mistakes much quicker and correct them easily. Keep going.

I dont rightly remember but I dont think I added the

opening and closing

Are there any other exercises that I could practice doing anchor text maybe until I can get it down properly

Well I don’t know if there will be more in the course you’re currently taking, but it’s likely you’ll have to do it again sometime.

This course also teaches you about it.

But don’t worry, creating links is super easy. You probably just made a silly mistake. It happens, especially when just getting started. Simply remember <a href="example.html">Text</a>, and don’t forget to follow the instructions carefully and you should be just fine :wink:

1 Like