FAQ: Languages for Web Development - Applying CSS

In a real scenario, does the code linking CSS to HTML have to be on line 6?

The line we put the link element on is not important. If there is more than one CSS file it is important that they are loaded in the correct order, but other than that, it won’t matter.

My preference is to have the charset come first in the head, followed by the title. After that the CSS and after that any script.

<!DOCTYPE html>
<html>
  <head>
    <charset="UTF-8">
    <title>Title close to the top is easier to search engines to find</title>
    <link rel="stylesheet" href="#">
    <script src="#">
  </head>
  <body>

  </body>
</html>
1 Like

the place you must to copy and paste that code in tabs index.html on the top, choose the tab index.html and do the question

1 Like

I had the same issue! I was hoping I wasn’t alone. Nice to know I wasn’t. I swear if it was a snake… bite bite bite!

omg thank you!!! I thought I was losing my mind following the directions to the T!

Hi Team,

How Do I know where to put the CSS link? in the exercise, it was pasted it on line 6 of the index.html why was that?

thank you!

Your question has already been answered in this thread, specifically this comment

Thank you for the answer, it is clear now for me.

1 Like

Good day, everyone. Quick one. Are certain HTML attributes designed for only certain HTML elements? E.g and rel=‘’ or and href=‘’. Thanks

There are a number of attributes that apply only in certain circumstances, and a good many that are ‘global’ and may be applied on any element.

Go to this page:

HTML elements - HTML5

Every HTML5 element is listed here, and each has its own page with all the specifications spelled out. For instance, click the top item, a - hyperlink, and read the page carefully, top to bottom.

You will see that global attributes are allowed, as well as a short list of special attributes not intended for every element. Compare this page to a few others just to get a gist of how the documentation is set out, and bookmark the link above for handy reference. Use this reference often, especially when learning about new elements.