Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I am getting CSS SyntaxError, unexpected token {. But I can not see error

In Wordpress on localhost Laragon I am trying to get CSS. It throws 403 error: enter image description here

enter image description here

I can't find error, what could it be?

like image 341
Mario Nezmah Avatar asked Nov 29 '22 13:11

Mario Nezmah


2 Answers

You're probably using wp_enqueue_script() Wordpress function to include your stylesheet file, and that's what could cause the error because it will call the css file using script tag.

Try using wp_enqueue_style() function instead.

like image 40
Okba Avatar answered Dec 01 '22 02:12

Okba


You css file is being processed as a javascript file. Are you sure the file is being included as a css file as in

 <link href="style.css" rel="stylesheet">

and not

<script src="style.css"></script>

Also if you are adding this in code make sure you are using the wp_enqueue_style() method

like image 168
Noel Kriegler Avatar answered Dec 01 '22 01:12

Noel Kriegler