CSS Unused CSS Stages Media Queries Device-Specific Media Queries: Part 1

Link attribute in anchor tag

Hello, can someone help me to understand what purpose the 'link' attribute in the anchor element serves? As is the document to this lesson:

<a link href="#">My Link 1</a> 

Thanks in advance :)

Shawn Flanigan
Shawn Flanigan
Pro Student 15,803 Points

Good question. As far as I know, link isn't a valid attribute...must be a mistake.

3 Answers

Steven Parker
Steven Parker
203,190 Points

According to W3C, "link" is not an attribute for an anchor tag, nor is it a global attribute. You could use it as a CSS selector, something like this:

a[link] { background: red }

But there are better ways to handle that, and I don't see that being used in the video or examples. I think it's a mistake, but I'll try asking the support folks and let you know what they say.

Steven Parker
Steven Parker
203,190 Points

They wrote me back and said, " ...ask in the forum. Once you've posted this, our teachers can then provide assistance...". So I guess we wait and see if a teacher posts here.

Thanks for confirming my doubts. I was afraid I was grossly misunderstanding what I read on the w3c site... Thank you :)

Guil Hernandez
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Guil Hernandez
Treehouse Teacher

Hi everyone,

Great catch on the extra "link" text in the anchor elements. Yep, it's not supposed to be there – looks like it's a stray attribute that managed to stay around when building the course. It doesn't really affect anything, but still, it's not necessary.

I'm going to refresh many of those videos soon, so it will be fixed. For now, I removed it from all the project files and code challenges.

Thanks!