Regarding anchor elements


Hello World!

So far I've had a great time learning HTML for the first time but I'm having trouble understanding why the angle bracket in the anchor element is open when adding a link.

Example: < a href="">This Is A Link To Wikipedia< /a>

Why isn't the angle bracket closed at the opening tag, and why is there another angle bracket right after the link?


Replace this line with your code.

<do not remove the three backticks above>


anchor elements are not very different from paragraph elements:


only difference is that we add an attribute (href) to the opening tag of the anchor element

which angle bracket are you referring to? we have four: lesser then (<), greater then (>) at the opening tag and same at the closing tag


I was referring to the (>) angle bracket in the opening tag. Shortly after posting this I realized exactly what you said, the (href) attribute is added inside the opening tag of the anchor element. Same as an (src) attribute is added directly inside an element… but you knew that


yep, seems you understand now as well, > didn’t come out of the blue, the attribute is simply added inside the opening tag (so before the > which closes a tag, in this case the opening tag)

this applies to all attributes


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.