Results 1 to 8 of 8

Thread: Property box-shadow doesn't exist in CSS level 2.1 ERROR

  1. #1
    Join Date
    Sep 2009
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Property box-shadow doesn't exist in CSS level 2.1 ERROR

    I have a Jquery Plugin and it includes a CSS for curve corners but when I validate it in the Validator, it says

    'Property box-shadow doesn't exist in CSS level 2.1 but exists in [css3]'

    'Property -moz-box-shadow doesn't exist : 0 2px 3px #444 '

    'Property box-shadow doesn't exist in CSS level 2.1 but exists in [css3] : none '

    those kind of errors.

    I have this CSS code

    Code:
    				box-shadow: 0px 0px 6px #000;
    				-moz-box-shadow: 0px 0px 6px #000;
    				-webkit-box-shadow: 0px 0px 6px #000;
    				padding:4px 10px 4px 10px;
    				border-radius: 6px;
    				-moz-border-radius: 6px;
    				-webkit-border-radius: 6px;
    what can i do to make it valid? I'm thinking of a doctype or something like to make it compatible with my code. thanks!

  2. #2
    Join Date
    Sep 2008
    Location
    Seattle, WA
    Posts
    135
    Thanks
    1
    Thanked 11 Times in 11 Posts

    Default

    Yeah, none of that will validate since the 'radius' statements are specific to two browser types and CSS3 isn't out yet for the border and box-shadow elements aren't supported. Bummer, eh?

    Here's a link to a rounded corners method that does validate:

    http://www.cssplay.co.uk/boxes/snazzy.html

  3. #3
    Join Date
    Sep 2009
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Oh crap. I'll just edit that with the ones you gave. Thanks man. Hope they fix that to work on all browser in the future;.

  4. #4
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    well, here's something to consider: although it doesn't validate, it does work. and there are several different lines to make it work across browsers.

    So, why do you want your code to validate? Just to make sure it works? It works, so don't worry. Valid markup isn't garunteed to work anyway.

    Do you want your client to see that your work validates? Put all the non-validatable (is that a word?) code into a seperate file. That way, it's easier to explain why these few things don't validate (but still work and are "good") and, at the same time, show that you do know what you're doing and can write valid code.


  5. #5
    Join Date
    Nov 2006
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,920
    Thanks
    2
    Thanked 267 Times in 262 Posts

    Default

    Hi there nihilater,

    if you validate your css here...

    ...click "More Options" and you will find the the default setting is "CSS level 2.1".

    Set to "CSS level 3" your code will validate, except for the propriety attributes, of course.

    coothead

  6. #6
    Join Date
    Sep 2009
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Yep, cuz I need to make sure my employer sees that the whole page is validated. Hmm, but I guess I can argue that with him that it really works although it doesn't validate. I just asked cuz i thought there was a solution or something.

    @coothead, thanks man, yeh it does lessen the errors. I didn't know there is such an option, thanks.

  7. #7
    Join Date
    Nov 2006
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,920
    Thanks
    2
    Thanked 267 Times in 262 Posts

    Default

    No problem. you're welcome.

  8. #8
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    Quote Originally Posted by nihilater View Post
    Yep, cuz I need to make sure my employer sees that the whole page is validated. Hmm, but I guess I can argue that with him that it really works although it doesn't validate. I just asked cuz i thought there was a solution or something.

    @coothead, thanks man, yeh it does lessen the errors. I didn't know there is such an option, thanks.
    Well, part of being a good coder is knowing what is best practice. There's plenty of resources online detailing the extent of accommodations that have to be made for various browsers, if your employer wants to know more.

    It doesn't just "work", it actually is the best way of doing things. (BTW, I would use the word explain rather than argue: you're not making an excuse for any shortcomings, you're explaining why what they want doesn't look exactly like they expected.)

    Good luck

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •