FAQ: Learn CSS Selectors Visual Rules - CSS Setup Selectors - Linking the CSS File



This community-built FAQ covers the “Linking the CSS File” exercise in Codecademy’s CSS lessons.

FAQs on the CSS exercise Linking the CSS File

Join the Discussion. We Want to Hear From You!

Have a new question or can answer someone else’s? Reply (reply) to an existing thread!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources about CSS in general? Go here!

Want to take the conversation in a totally different direction? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account, billing, Pro, or Pro Intensive? Reach out to our support team!

None of the above? Find out where to ask other questions here!


Other FAQs

The following are links to additional questions that our community has asked about this exercise:

Not seeing your question? It may still have been asked before – try searching for it by clicking the spyglass icon (search) in the top-right of this page. Still can’t find it? Ask it below by hitting the reply button below this post (reply).


In this example, (href="styl. . . " type=“text/css” rel. . . . ),
why is it written “text/css” rather than .css?
Thank you.


because its mime type, not the file extension, see docs:



Nice, a lot of good info there.
I always want to know, not only how something works, but why it works.
Makes it a lot easier to compehend.
Thanks again,



In learning to link the CSS and HTML, I have found different various ways to do this. Is there a standard way ? Or does it really matter if the “rel” attribute comes in the end or the beginning of the code?


it doesn’t matter, attribute order isn’t relevant.


Thank you for your help!!!


does the rel attribute always have to equal to stylesheet?


nope, but this you could have found in documentation:



why does it say set it equal to style.css and not ‘./style.css’ on step 2?
does a relative pathway in the same folder only need the file name and extension?


Correct. ./ is the current folder.


Are all three attributes (rel, type, and href) needed in the link element in order for the styling to be applied to the HTML document? I fiddled with it, and it worked without the “type” attribute.


the type attribute can indeed be omitted since html5


Thank you so much for that input.