So I’m currently doing the Basic HTML and HTML5: Nest an Anchor Element within a Paragraph lesson, and below is the main help text. I’ve completed this lesson, it was easy, however I don’t understand the bolded(and code formatted) section of the tutorial (look below for further explaination.)
You can nest links within other text elements.
<p>
Here's a <a href="http://freecodecamp.org"> link to freecodecamp.org</a> for you to follow.
</p>
Let’s break down the example:
Normal text is wrapped in the p element:
<p> Here's a ... for you to follow. </p>
Next is the anchor element <a> (which requires a closing tag </a>):
<a> ... </a>
href is an anchor tag attribute that contains the URL address of the link:
<a href="http://freecodecamp(dot)org"> ... </a>
I understand this part (this is essentially what I used to complete it.) It’s an anchor with a HyperText Reference pointing to freecodecamp(dot)org, with the display text of ‘…’
The text, “link to freecodecamp(dot)org”, within the anchor element called anchor text, will display a link to click:
<a href=" ... ">link to freecodecamp(dot)org</a>
I do not understand this part. Wouldn’t this attempt to link to ‘…’ with the text ‘link to freecodecamp(dot)org’? What is the point of this? Am I misunderstanding this or would this throw an error?
The final output of the example will look like this:
Here’s a link to freecodecamp(dot)org for you to follow.
(The (dot)s are because new forum members can only put 2 links per topic.)
This is my first topic on the forum so if this is in the wrong topic section please let me know and I’ll change it!