Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Ben Os
Ben Os
20,008 Points

What is the main difference (or differences) between a:default to a:link ?

Please note I asked this specifically about a's --- a:link & a:default ...

I don't believe 'default' is one of the pseudo class names for the anchor element. There are only four. (Active, Hover, Link, Visited)

2 Answers

Steven Parker
Steven Parker
231,269 Points

A big difference is support. :link is pretty universally supported, and has been for a long time. :default is much newer, and is not fully supported (not at all in IE, only partially in some other browsers).

Functionally, :link is specifically for links that have not been visited. :default is generally for input elements (buttons or checkboxes) that are the default choice. I'm not even sure if any browser would recognize this when attached to an anchor element.

Tommy May
Tommy May
12,056 Points

Here is the MDN developer documentation for those pseudo-classes

:defualt :link

The main difference is that :link references all links that have not been visited yet, while :default can refer to more than just links such as selecting the default selection in a form.

Hope this helps!