Link tag


In the link tag, what is the type, rel and href?
Please someone explain.


type is no longer required to specify in html5. Anyway, MDN always has great documentation, also about <link>, href stands for hyperlink reference, which means href tells <link> where the css file is located


Still do u know whats the type and rel?


i provided a link to excellent documentation, read it, if you have any questions after that, i will answer them


sorry i didnt notice the link earlier. Yep i read it now and its quite clear. So if rel is used state a relation btwn the external doc and the current one then can it be anything other than "stylesheet"? can it be "html"? or"txt"?


the page you where on contain a link to a page about rel (you can find the page here), which list all possible values for rel, i don't see html or txt, why would you want to do that?


Thanks I got the concept of rel now.
I was just curious if we could link up other formats if needed in future.
Sorry for the many questions but i dont understand when we write "text/css" in type, why do we write text/css and why not stylesheet/css?
Can we give it any random name/css?



no, we can use other tags for that, for example if we want to embed a txt file:

<object data="/path_to_text_file/text.txt" type="text/plain" style="height: 300px height: 500px">
<a href="/path_to_text_file/text.txt">No Support?</a>

or if you want to embed a html file:

<iframe src="page.html" width="300" height="300">
 <p>Your browser does not support iframes.</p>

type's values are fixed, certain things needs to be fixed, otherwise it would be such a mess. If things aren't fixed/standardized, your computer need to support all those values, that would be a disaster


Got it Thanks a lot :+1: