Anchor text missing, but I put one in

Tell us what’s happening:

Your code so far

<main>
  <h2>CatPhotoApp</h2>
<a href="https://freecatphotoapp.com" alt="cat photos"</a>

</main>```  
 Here's the error message; Your

a


element should have the anchor text of "cat photos". Your

a


element should have the anchor text of "cat photos". Your

a


element should have the anchor text of "cat photos".

<main>
<h2>CatPhotoApp</h2>
<a href="https://freecatphotoapp.com" alt="cat photos"</a>

</main>

The error message says

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36.

Challenge: Link to External Pages with Anchor Elements

Link to the challenge:

the anchor text is between the opening and closing tag, you are missing the > of the closing tag and there is no text between the tags, also alt is not valid attribute for anchor elements

I can’t understand what you are saying.

This is too confusing. i give up for today.

an element has an opening tag, like <p> and a closing tag, like </p>

for your a you have this as opening tag:

you are missing the >

I had tried just adding ‘>’ and got the same message. what i have above is as in the example. Could you please just show me what the could should look like?

what do you have now as your code?

that was not the only change needed

i don’t know what i had. I couldn’t find my place in the course by signing in, so i had to start all over again and do all the lessons up to here [How can i avoid this in the future without leaving the tab open and the computer on?]. When i did that, this is what I have:

<main>
  <h2>CatPhotoApp</h2>
<a href="https://freecatphotoapp.com" a="cat photos">
</main>

Please, just tell my what I SHOULD have. This is just building my affective barrier.

Also, what do the colors mean?

We have found that just being handed answers interferes with learning.

if you look at the list of challenges you can go to the next one just clicking on it

the solutions can be easily found, we don’t give them on the forum. We answer questions, give hints, point out error and help people come to the answer on their own.

the different colors rapresent different parts of the html elements, in bold and orange (here on the forum with dawn theme at least) the element names, in purple the attribute names and in orange the attribute values, and in white, text
image


now, to return to the challenge, this is the given example:

<a href="https://freecodecamp.org">this links to freecodecamp.org</a>

in this case a is the element name, of which <a> is the opening tag, and </a> is the closing tag.
the attributes go inside the opening tag, in this case we have href, which point to the destination of the link
also, between the two tags there is the text “this link to…”, that is the anchor text in this case

1 Like

I’m not sure why you called this a. The example used alt.

That is contrary to pedagogical theory. Sure, at first the learner should try to work it out, but at one point, not giving the answer kills the learner’s interest. This is called raising the affecti ve barrier.

we are not hiding the answers, they can be easily found. We just do not give them out on the forum as in general people come here to ask for help so that they can arrive to the solution with some hints but in their own.

1 Like

I have taught at many years at the university level and have received many awards for teaching excellence. Just handing out answers is contrary to good pedagogical theory. Engagement and understanding is learning, not copying.

1 Like

I did it because 1) when I used alt, I got the message that a wasn’t closed and 2) I was trying to close a.

to close the opening a tag you need to add the > but keep the closing a tag there

1 Like

The error about the improperly closed a tag came from the </a> in your code. Syntax is very precise, so you should be suspicious when make a change that makes your code more different from the given example or the documentation.

Well, i have also taught for many years at levels including university (which, I think is not really the most relevant for this kind of course) and have studied educational theory based on research and I also know my own reaction. Not giving a simple answer when someone is thoroughly confused is bad pedagogy.

Also, where is the list of challenges?

at freecodecamp.org/learn, you can expand all the sections to see the challenges

1 Like