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

Time:01-13

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)"

CodePudding user response:

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

CodePudding user response:

In your html put all <script> tags inside the <head> tag as follows:

<head>
  <link src="../css/style.css" rel="stylesheet"></link>
  <script src="[ENTER JQUERY URL HERE]"></script>
  <script src="[ENTER ANOTHER URL HERE]"></script>
</head>
  • Related