Search code examples
csssyntaxsyntax-error

Uncaught SyntaxError: Unexpected token '{' (at style.css:1:4)


I'm trying to use a stylesheet. However, I keep getting this error: "Uncaught SyntaxError: Unexpected token '{' (at style.css:1:4)"

My html

My css

I've tried moving the '{' to the next line (which worked) but then it says: "Uncaught SyntaxError: Unexpected token ':' (at style.css:3:11)"


Solution

  • in your HTML use <link rel="stylesheet" href="../css/style.css"> instead. CSS Styles are not scripts