What is href and rel? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is href and rel?

2nd Feb 2018, 9:10 AM
Aditi Bajpai
Aditi Bajpai - avatar
3 Answers
+ 7
well...... href is created with the tag <a> (you do know it) links(not clickable) are placed inside the head tag (always) and usually describes the relationship eg( <link rel="yourDoc.css"/> to fetches css mostly) between current document and another document while... anchors (clickable)eg (<a href="https://www.google.com"> google</a>) are placed inbetween the <body> tag to access resources from same/or another webpage...
2nd Feb 2018, 9:33 AM
_c0d£ Bit£_
_c0d£ Bit£_ - avatar
+ 2
href is a hyperlink reference -> a reference to a file. This can be a link or an absolute or relative path. rel further classifies the use of the file, e.g. as stylesheet.
2nd Feb 2018, 9:18 AM
Andreas K
Andreas K - avatar
+ 2
ehm @Roy in xhtml standard you link to a Css file using <link rel="stylesheet" href="<path or link>/style.css" /> So your first assumption using ahref only in the <a> tag is wrong.
2nd Feb 2018, 9:36 AM
Andreas K
Andreas K - avatar