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

3

10

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.

Miliary answered 20/4, 2011 at 21:54 Comment(2)
Possible a comment that wasn't closed properly? Seems you've fixed it because when I click on that link I get no warnings or errors.Midyear
@stealthyninja: The error was never on that link. It was Firefox's error console showing the error.Slier
S
13

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" />
Slier answered 20/4, 2011 at 22:10 Comment(2)
Well I be damned. Nice find! How'd you figure it out or just experience?Miliary
I've not come across this one before either :) I figured this out by copying your HTML code into a local file, and eliminating parts of the code as the cause. Firstly, I removed all JavaScript - no change. Then I removed all CSS - the error was gone. Then, I looked closely at how you were importing the CSS file, and it jumped out at me.Slier
W
3

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..

Wildee answered 20/4, 2011 at 22:2 Comment(0)
J
2

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

Jourdain answered 21/9, 2011 at 11:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.