CSS: An Overview

<link type="text/css" rel="stylesheet" href="stylesheet.css" />

Can you please tell me what this does because I don't understand what it does?


Alright, so you know how you have the .css tab on the top of your coding window?

Well in a regular program that's a completely different file. You have the .css file, and the .html file. so in the .html file you're able to link the two files together with that <link> tag.


Oh okay thank you so much.


Yes, we have two files here: index.html and stylesheet.css, this link connects these two files together

href you know from link (<a></a>), in the case of <link> it tells link where the css file is located.

Here is what MDN says about rel:
This attribute names a relationship of the linked document to the
current document. The attribute must be a space-separated list of the link types values. The most common use of this attribute is to specify a link to an external style sheet: the rel attribute is set to stylesheet, and the href attribute is set to the URL of an external style sheet to format the page. WebTV also supports the use of the value next for rel to preload the next page in a document series.

and from type: (which is no longer required in html5)

This attribute is used to define the type of the content linked to. The value of the attribute should be a MIME type such as text/html, text/css, and so on. The common use of this attribute is to define the type of style sheet linked and the most common current value is text/css, which indicates a Cascading Style Sheet format.

source, Hope this helps


Thank you @stetim94 it did help.