CSS Warning

Twinkie

Banned
Messages
1,389
Reaction score
12
Points
0
Im OCD about keeping error free code, and I don't understand why this is popping up?
HTML:
Warning: Expected ':' but found 'switch'.  Declaration dropped.
for this code:
HTML:
body {background-color: lightblue;}
h2 {color: #903;}
table.main td.label {padding-right: 20px}
table.main input {width: 423px;}
span.switch {
cursor: pointer;
position: absolute;
float: left;
}
And the cursor: pointer; statement is dropped. Why am I getting this warning?
 

leafypiggy

Manager of Pens and Office Supplies
Staff member
Messages
3,819
Reaction score
163
Points
63
Don't you mean CDO ( OCD with the letters in the right order) ???


LOL

Well, I didn't think you need span.

Just .<element>

Not completely sure though.

--Neil
 

Twinkie

Banned
Messages
1,389
Reaction score
12
Points
0
To the best of my knowledge, putting the element in the declaration is legal, and a precaution against faulty code. When I remove it, the warning is still there *twitches* :p
 

quantum1

New Member
Messages
68
Reaction score
0
Points
0
I ran your css source above through my TopStyle checker and it said that CSS level 1 does not support cursor and position. If you are using CSS level 1 that might be the problem.
 

xPlozion

New Member
Messages
868
Reaction score
1
Points
0
cursor as stated prior is not valid css code. also, there's a semicolon missing, but i don't know if that'll make an error down the line.

Code:
body {background-color: lightblue;}
h2 {color: #903;}
table.main td.label {padding-right: 20px;} /* semicolon here */
table.main input {width: 423px;}
span.switch {
/* cursor: pointer; /* not valid css code */
position: absolute;
float: left;
}

other than that, the rest of it looks right.

I too am a clean freak when it comes to code and errors. I like my pages Valid XHTML Strict and valid css, as well as clean, optimized easy to read php code.
 
Last edited:

Twinkie

Banned
Messages
1,389
Reaction score
12
Points
0
I will see if that helps, thanks. What would be the valid way to change the cursor?

I would give reputation if I hadn't given some to you recently :(
 
Last edited:

diabolo

Community Advocate
Community Support
Messages
1,682
Reaction score
32
Points
48
can someone explain to me the use of "." in the css; I have only used it to define classes; and when i do I would put "span .switch" and might be the problem.
 

leafypiggy

Manager of Pens and Office Supplies
Staff member
Messages
3,819
Reaction score
163
Points
63
It means that <span class="switch">
would inherit those porperties
 

t2t2t

New Member
Messages
690
Reaction score
0
Points
0
Actually, diabolo said span .switch WITH space between them.

This rule means CSS will look for any element with class "switch" and which is inside a span element. But if you take space away, it will look for span element with class switch. (space and > mean "Look inside for...")
 

Twinkie

Banned
Messages
1,389
Reaction score
12
Points
0
I added the semicolon with no luck... Here is the link to the real page.

Don't be tempted to use the form, it's my MySQL testing page, I congratulate those who find the hidden treasure in the page :D

http://supertwinkie.co.cc/SQL_Form.html

How would you send a + sign over AJAX POST for a MySQL Query using JavaScript??

The escape and encodeURI functions both ignore the + sign :(
 
Last edited:

t2t2t

New Member
Messages
690
Reaction score
0
Points
0
HTML:
<span style="switch" id="shortcut" onclick="Switch();">&nbsp;</span>
The error is here.

(Hint)
 

xPlozion

New Member
Messages
868
Reaction score
1
Points
0
lol, nice find ;)

this should be the correct code
Code:
<span class="switch" id="shortcut" onclick="Switch();">&nbsp;</span>
 

Twinkie

Banned
Messages
1,389
Reaction score
12
Points
0
Wow, how did I miss that! Thank a lot, that error was the work of Dreamweaver auto complete.

Is it possible to send a + sign over AJAX?
 

xPlozion

New Member
Messages
868
Reaction score
1
Points
0
Wow, how did I miss that! Thank a lot, that error was the work of Dreamweaver auto complete.

Is it possible to send a + sign over AJAX?
thus another reason i stick with hand coding everything, including html.

as far as the plus sign and ajax goes, how are you sending it? as a url like google does or as a part of an input field?

if worst comes to worst, you can escape it before sending it, then unescape it after
 

Twinkie

Banned
Messages
1,389
Reaction score
12
Points
0
I hand code too, Dreamweaver just helps me out. I made a change to the styles to make it a class, and just slipped my mind to change the tag.

I am sending it through standard AJAX post for a MySQL query, using the escape function to encode the parameters. The escape function ignores the + sign, because it signals a space in a URI. Same page. Click the space at the top left corner of the page. Select query response and type:
Code:
SELECT CONCAT('1 + 1 = 5');
It responds without the + sign. I could encode and decode it with a user defined function, but I am hoping that I won't have to. Any ideas?

Well I didn't think there was a function to do that. Thanks for your help. I will rep you all if I hadn't recently.
 
Last edited:
Top