+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: CSS Warning

  1. #1
    Twinkie is offline Banned Twinkie is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    Ft. Lauderdale, Florida
    Posts
    1,389

    CSS Warning

    Im OCD about keeping error free code, and I don't understand why this is popping up?
    HTML Code:
    Warning: Expected ':' but found 'switch'.  Declaration dropped.
    for this code:
    HTML Code:
    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?

  2. #2
    leafypiggy's Avatar
    leafypiggy is offline Community Advocate leafypiggy is on a distinguished road
    Join Date
    Aug 2007
    Location
    Massachusetts
    Posts
    2,228

    Re: CSS Warning

    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
    Neil Hanlon | x10Hosting Support Representative
    Neil[at]x10hosting.com
    █ I'm always happy to help. Just ask a question in Free Hosting
    Terms of Service IRC

  3. #3
    Twinkie is offline Banned Twinkie is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    Ft. Lauderdale, Florida
    Posts
    1,389

    Re: CSS Warning

    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

  4. #4
    quantum1's Avatar
    quantum1 is offline x10Hosting Member quantum1 is an unknown quantity at this point
    Join Date
    Sep 2008
    Location
    near Nashville, TN
    Posts
    68

    Re: CSS Warning

    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.
    Two rules of development:
    1) Computers work for people; People do not work for computers
    2) Maintainability is all that matters.

  5. #5
    xPlozion's Avatar
    xPlozion is offline x10 Elder xPlozion is an unknown quantity at this point
    Join Date
    Mar 2008
    Location
    Delaware, USA
    Posts
    872

    Re: CSS Warning

    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 by xPlozion; 01-01-2009 at 01:35 AM.

  6. #6
    Twinkie is offline Banned Twinkie is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    Ft. Lauderdale, Florida
    Posts
    1,389

    Re: CSS Warning

    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 by Twinkie; 01-01-2009 at 01:20 PM.

  7. #7
    leafypiggy's Avatar
    leafypiggy is offline Community Advocate leafypiggy is on a distinguished road
    Join Date
    Aug 2007
    Location
    Massachusetts
    Posts
    2,228

    Re: CSS Warning

    Its definetly valid.

    http://www.w3schools.com/CSS/pr_class_cursor.asp

    as stated there, it can also be changed with JavaScript
    Neil Hanlon | x10Hosting Support Representative
    Neil[at]x10hosting.com
    █ I'm always happy to help. Just ask a question in Free Hosting
    Terms of Service IRC

  8. #8
    xPlozion's Avatar
    xPlozion is offline x10 Elder xPlozion is an unknown quantity at this point
    Join Date
    Mar 2008
    Location
    Delaware, USA
    Posts
    872

    Re: CSS Warning

    Quote Originally Posted by leafypiggy View Post
    Its definetly valid.

    http://www.w3schools.com/CSS/pr_class_cursor.asp

    as stated there, it can also be changed with JavaScript
    your right ;) i was thinking the scroll bars for some weird reason xD

    according to the css validator (w3), the only error is the background color : lightblue. it says that's not a valid color.
    http://jigsaw.w3.org/css-validator/validator
    Last edited by xPlozion; 01-01-2009 at 02:28 PM.

  9. #9
    leafypiggy's Avatar
    leafypiggy is offline Community Advocate leafypiggy is on a distinguished road
    Join Date
    Aug 2007
    Location
    Massachusetts
    Posts
    2,228

    Re: CSS Warning

    Hmmm..

    maybe try

    #ADD8E6 (which is LightBlue)

    or another color from http://w3schools.com/css/css_colornames.asp
    Neil Hanlon | x10Hosting Support Representative
    Neil[at]x10hosting.com
    █ I'm always happy to help. Just ask a question in Free Hosting
    Terms of Service IRC

  10. #10
    diabolo's Avatar
    diabolo is offline Community Advocate diabolo is on a distinguished road
    Join Date
    Nov 2007
    Location
    Jersey Shore
    Posts
    1,683

    Re: CSS Warning

    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.

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 14
    Last Post: 09-29-2008, 07:07 PM
  2. It works! ...
    By bpakidz in forum Programming Help
    Replies: 4
    Last Post: 09-07-2008, 11:12 PM
  3. New Site-Suggestions?
    By mnoutside in forum Review My Site
    Replies: 9
    Last Post: 08-27-2008, 07:01 AM
  4. GeIP Script Help
    By cybahq in forum Scripts & 3rd Party Apps
    Replies: 4
    Last Post: 07-30-2008, 06:19 AM
  5. GeIP Script Help
    By cybahq in forum Free Hosting
    Replies: 4
    Last Post: 07-30-2008, 05:08 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers