Unexpected Token at Line 1 col 1 - The <Style> Tag


#1

I have copy pasted the hint after struggling to finish this and it is still giving the same error, i then went to the first stage and looked at how that style.css was started but still wont work, any help is appreciated as the tutorial doesnt seem to explain what im missing and the hint is simply the answer (which doesnt seem to work).
Capture


#2

Solved, bad wording by the tutorial, wants it in the main index page not the style page.


#3

Hi @trmorgan95,

Just for completion, I would like to add that:

Another clue is that when you see this tag format <something></something> , it’s more likely it’s part of HTML elements. I don’t know if you have learnt about CSS from the exercise yet, CSS syntax doesn’t involve <something></something> tag format, therefore the error: unexpected token '<' show up in the style.css (which is the stylesheet).

Soon you will understand that any file that ends with .html is a HTML file, whereas, any file that ends with .css is a stylesheet for the HTML file, which referred as CSS file. And HTML elements should only be inserted in HTML file, not otherwise, if not error would error because the syntax used is different.

More info about CSS syntax:

Have fun coding! :slight_smile:


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.