What is the difference between a
and a:link
, and when do I use one over the other?
The <link> element appears in the <head> of a HTML document, and could have all the same attributes. The difference between a <link> and <a> is that a <a> may contain text and usually appears in a document, whereas the <link> element doesn't have content.
According to W3C a:link is for not visited, a:visited is for visited, and just a applies to both.
<a> is the html element used to display an hypertext reference link (clickable anchor) in <body> part (content) of the page, while <link> is used in <head> part (document meta informations) to link an external ressource file to the document... Wow, awesome community.
The anchor tag <a> is used to create a hyperlink to another webpage or to a certain part of the webpage and these links are clickable, whereas, link tag <link> defines a link between a document and an external resource and these are not clickable.
a:link
is specifically for links that have not been visited. a
applies to all <a>
elements.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With