4

I have been trying to validate my CSS, and the following lines continually return the error Parse Error [empty string]

.content { width:80%; text-align:center; margin-left:auto; margin-right:auto; 
max-width:400px; border-width:4px; border-style:solid; border-color:#339900; 
padding:5px; margin-top:10px; margin-bottom:10px; border-radius:20px; 
background-color:#ccffcc; }
#side_link { position:fixed; bottom:5px; right:-4px; 
background-image:url('img/FruitfulLogo.png'); height:29px; width:22px; 
border-style:solid; border-width:2px; border-bottom-left-radius:5px; 
border-top-left-radius:5px; border-color:#F90; background-color:#FF9; }
#side_link:hover { background-image:url('img/FruitfulLogo_over.png'); }

Am I missing something really obvious or really obscure?

5
  • What validator are you using? jigsaw.w3.org/css-validator seems to think it is fine, other than your border radius... Commented Apr 29, 2011 at 20:25
  • 1
    @kjl: Most probably W3C Jigsaw (official one) as it gives the same errors for me. And you're getting those errors because you're validating against CSS2.1, not CSS3. Commented Apr 29, 2011 at 20:26
  • @BoltClock - Ah I see it, forgot to change css to version 3 Commented Apr 29, 2011 at 20:28
  • 1
    Used the jigsaw validator - set to validate CSS level 3 and I'm continually getting these errors! I've almost obsessively cleaned up the CSS in my actual document also! Are you getting the same errors validating in CSS3 or is it just a glitch? @kjl is there something wrong with my border radius? Commented Apr 29, 2011 at 20:31
  • I agree with the validator bug comment. Take out your border-radius items in .content and #side_link and it validates fine. As far as I can see, they are correct. Commented Apr 29, 2011 at 20:44

5 Answers 5

3

Apparently, the border-radius throwing a Parse Error [empty string] is a bug in the W3C CSS validator.

See http://www.w3.org/Bugs/Public/show_bug.cgi?id=11975 .

Sign up to request clarification or add additional context in comments.

Comments

2

You're using css3 elements while this is still just a draft. The w3 validators aren't yet equiped to deal with a lot of the new properties and attributes and they'll spew out errors on perfectly valid css in some cases. This is one of them.

Just give them a year-or more- to patch things up. Until then, use your own judgement, css is relatively simple syntax wise.

2 Comments

I think border-radius is not in draft anymore, that's way all browsers support it without vendor prefixes.
@x64igor I haven't been able to find the 'official' version of the border module, so I am assuming it is still in draft status w3.org/TR/2002/WD-css3-border-20021107/#the-border-radius regardless, the validator has weird behaviour on other properties as well, like the short hand font property, which doesn't validate either when the fonts-size/line height short is used.
0

As @BoltClock commented as well, this appears to be a validator bug.

Take out your border-radius items in .content and #side_link and it validates fine. As far as I can see, they are correct.

Comments

0
.content {
    margin:10px auto;
    padding:5px;
    border:4px solid #390;
    border-radius:20px;
    width:80%;
    max-width:400px;
    background-color:#cfc;  
    text-align:center;
}

#side_link {
    position:fixed;
    bottom:5px;
    right:-4px;
    width:22px;
    height:29px;
    border:2px solid #F90;
    border-radius:5px 0 5px 0;
    background-color:#FF9;
    background-image:url('img/FruitfulLogo.png');
}

#side_link:hover {
    background-image:url('img/FruitfulLogo_over.png');
}

I'm going to concur that the validator is going nuts, because when I input the above, it shows the errors. But then you have to note that below the errors it outputs all of the above and says "all this stuff is valid."

Comments

0

I put it throught the W3C validator and this is what I got back.

3: .content - Property border-radius doesn't exist in CSS level 2.1 but exists in : 20px 20px

7: #side_link - Property border-bottom-left-radius doesn't exist in CSS level 2.1 but exists in : 5px 5px

8: #side_link - Property border-top-left-radius doesn't exist in CSS level 2.1 but exists in : 5px 5px

When checking the CSS3 version it's the same line numbers.

4 Comments

Because you're validating against CSS2.1, not CSS3.
When checking the CSS3 version it's the same numbers.
I'm having the same problem then. Is there anything wrong with my CSS or is this a validator problem do you think?
I don't think it's the CSS I think it's the validator. Since the rule isn't really generating an error, it looks as if the validator isn't seeing anything between the { and the }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.