Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS Error: Expected ':' but found '/'. Declaration dropped. Line: 0

I'm getting this one warning/error in all my CSS files for some reason and I can't quite figure it out. When I run my CSS through the W3C Validator it comes out 100% valid correctly formatted etc. However, when using the web developer toolbar in Firefox I get this warning:

Warning: Expected ':' but found '/'. Declaration dropped. Source File: filename.php Line: 0

Has anyone else run into this problem? I understand this isn't really a big problem and normal users would never see this but I'm just more curious as to what is causing this.

I searched Google but wasn't able to find anyone else with the same problem so hopefully someone on here can help.

like image 652
Grant Avatar asked Apr 20 '11 21:04

Grant


3 Answers

Looking at this page:

http://cgtweb2.tech.purdue.edu/356/gwindes/project2/

I get the error you described in Firefox's error console.

The reason for this is not inside the CSS file - it's in how you're including the CSS file:

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

Can you see it?

It's that style attribute :)

It should be like this instead (style -> type):

<link href="style.css" type="text/css" rel="stylesheet" />
like image 168
thirtydot Avatar answered Oct 23 '22 20:10

thirtydot


Your error is not in your CSS files. Your error is in your php file(s), and is probably a space at the beginning of filename.php or something related. Without seeing your PHP it's hard to determine what is causing your error, but could be something related to a rewrite rule, importing of a file, etc..

like image 3
TNC Avatar answered Oct 23 '22 20:10

TNC


For me style="height=46px;" gave the error, i corrected it back to style="height:46px;". The warning is related to CSS.

like image 2
Nitesh Avatar answered Oct 23 '22 19:10

Nitesh