I have some confusion between <link>
and <a>
.
I know that in order to add CSS to an HTML document we use the <link>
tag, for example:
<link type="text/css" rel="stylesheet" href="/spinner/styles.css?ln=css" />
But, I can't understand why we do not use an anchor <a>
tag (as it contains the same necessary attributes), something like:
<a type="text/css" rel="stylesheet" href="/spinner/styles.css?ln=css" />
Are these two tags interchangeable? Also, if this is possible, then how do we choose one over the other and why?
Update:
I got that confusion, because I saw in The Complete Reference HTML & CSS book regarding the rel
attribute of the <a>
Tag, that:
rel: For anchors containing the href
attribute, this attribute
specifies the relationship of the target object to the link object.
So I thought that it could do the same function as the <link>
tag.
question from:
https://stackoverflow.com/questions/28650076/link-vs-a-when-to-use-one-over-the-other 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…