EzDevInfo.com

css-validator

W3C CSS Validation Service The W3C CSS Validation Service

CSS Validator - Ruby

I have the css-validator.war provided by W3C running locally on JBoss.

I have whipped together a very quick script to test it out:

require 'net/http'
require 'uri'

doc = '
* html {
    font-family: tahoma;
    background-color: black;
}
'

res = Net::HTTP.post_form(URI.parse('http://localhost:8080/css-validator/validator'),
  {'uri' => 'none', 'profile' => 'css2','usermedium' => 'all', 'type' => 'none', 'lang' => 'en', 'warning' => '1', 'output' => 'soap12', 'text' => doc})

response = res.body

puts response

When I browser to the validator in my web browser I can paste the CSS in fine and it validates fine but when I run this script I get an error page saying:

I/O Error: You have sent an invalid request.

I have checked the parameters that I am passing and they seems fine.

Does anyone have any idea why this would be happening?

Cheers

Eef


Source: (StackOverflow)

@media error for webkit or coding

When using css validator http://jigsaw.w3.org/css-validator/, I get this error for the following: I read that webkit shouldn't be used, what is wrong with the code?

@media (-webkit-min-device-pixel-ratio: 1.3), (-o-min-device-pixel-ratio: 2.6/2), (min-moz-device-pixel-ratio: 1.3), (min-device-pixel-ratio: 1.3), (min-resolution: 1.3dppx) {

.nivo-lightbox-theme-default .nivo-lightbox-content.nivo-lightbox-loading { 
    background-image: url(loading@2x.gif); 
    background-size: 32px 32px;
}
.nivo-lightbox-theme-default .nivo-lightbox-prev { 
    background-image: url(prev@2x.png); 
    background-size: 48px 48px;
}
.nivo-lightbox-theme-default .nivo-lightbox-next { 
    background-image: url(next@2x.png); 
    background-size: 48px 48px;
}
.nivo-lightbox-theme-default .nivo-lightbox-close { 
    background-image: url(close@2x.png); 
    background-size: 16px 16px;
}

}


Source: (StackOverflow)

Advertisements

Reddit custom flair CSS validation

This works fine:

.flair-bgomod {
  background-color: white;
  color: purple;
  border: 1px solid gray;
  border-right: 3px solid red;
  padding-left: 2px;
  padding-right: 2px;
}

But when I add this (which is basically a copy/paste):

.linkflair-classic .linkflairlabel {
  background-color: white;
  color: brown;
  border: 1px solid brown;
  border-right: 3px solid brown;
  padding-left: 2px;
  padding-right: 2px;
}

I get the following validation errors:

[line 1] "1px" is not a valid value for CSS property "border"
 .flair-bgomod {
[line 1] "solid" is not a valid value for CSS property "border"
 .flair-bgomod {
[line 1] "brown" is not a valid value for CSS property "border"
 .flair-bgomod {
[line 1] "3px" is not a valid value for CSS property "border-right"
 .flair-bgomod {
[line 1] "solid" is not a valid value for CSS property "border-right"
 .flair-bgomod {
[line 1] "brown" is not a valid value for CSS property "border-right"
 .flair-bgomod {
[line 14] invalid CSS property list "border: 1px solid brown"
   border: 1px solid brown;
[line 15] invalid CSS property list "border-right: 3px solid brown"
   border-right: 3px solid brown;

WTF?


Source: (StackOverflow)

how to check what css code is invalid using browser plugins [closed]

I was looking around different browsers plugins to find out what kind of developer tool I can use to verify what invalid css code or line I have in my html pages or css files. I want to know if common browsers such as Chrome or FF have the ability with some plugin to test or check valid and invalid css property. I know that Chrome has inspection element tool by default through the mouse by right-click and selecting the last option. However, it doesn't seem that this tool can show what code is incorrect or what exactly invalid...

any idea about that?

Thanks


Source: (StackOverflow)

Are there any detailed instructions for how to use css-validator.jar? [duplicate]

This question already has an answer here:

I am trying to use the local version of css-validator, but can't seem to get it to work. I think everything is set up correctly, but whenever I run it with the command given as an example by w3c, it gives errors. Some people say I am missing something in my path or something like that, but I am not sure which path they are talking about (build path or environmental variables), and I don't know what exactly needs to be put into this path either.

I have looked for detailed instructions, but the most detailed instruction I found was that it needed to be in lib (which lib, I see hundreds of them). For reference, here is the documentation of css-validator.jar that I have found so far (which is not much, consisting of nothing but a command to run in cmd prompt): http://jigsaw.w3.org/css-validator/DOWNLOAD.html

This is the part most relevant from there: Note : the css-validator.jar file must be located at the exact same level as the lib/ folder to work properly.

Also, I tried using the jcabi.w3c wrapper(which I thought it said it only needed one dependency, but another website said it needed more, including glassfish jersey-core), but it talks about all these dependencies that I don't know where to put them (its xml, but it doesn't seem to match an Ivy document) and many I don't even have or know how to set up.

The w3c wrapper simply says "No main in selection" when I try to run it (which is a message I have never even seen before in cmd). So how do I get this thing working? Where is the documentation (more than 3 lines that W3C provides please,)?

Also, the error I am getting when trying to use css-validator.jar:

C:\Users\burnjc\Downloads>java -jar css-validator.jar http://www.w3.org/
Exception in thread "main" java.lang.NoClassDefFoundError: org/w3c/tools/resourc
es/ProtocolException
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2531)
    at java.lang.Class.getMethod0(Class.java:2774)
    at java.lang.Class.getMethod(Class.java:1663)
    at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)
    at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)

Caused by: java.lang.ClassNotFoundException: org.w3c.tools.resources.ProtocolExc
eption
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    ... 6 more

Source: (StackOverflow)

How to fix Property overflow-y doesn't exist in CSS level 2.1?

How can I fix the following CSS error?

Property overflow-y doesn't exist in CSS level 2.1 but exists in [css3] : scroll

Is it ok to replace

html {  overflow-y: scroll; }

with

html{   overflow: scroll; }

Validated code : http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fwww.santiagomichalek.com%2Fmanage.php&profile=css21&usermedium=all&warning=1&vextwarning=&lang=en


Source: (StackOverflow)

W3C css-validator.jar: Where do I find documentation about local usage (parameters, etc.)?

I successfully installed W3C css-validator.jar locally as described here:

Is there an open source CSS validator that can be run locally?

Now I'm looking for some documentation about how to use it.

At the moment I'm doing something like this:

java -jar css-validator.jar --output=soap12 file:source.css > result.xml

I'd like to accomplish the following:

  • Output in a different format, e.g. XML (I guess that I can simply do --output xml for this)
  • Input a string directly without a file, e.g. string:"body { color: red; }"
  • Output the result directly without a file (so not like > result.xml) so I can do something like RESULT = java -jar css-validator.jar...

Any help on this is highly appreciated.


Source: (StackOverflow)

CSS Validator is saying my usage of text-wrap:suppress is invalid

I am using the W3C CSS Validator and it says that I have an error with the following code:

Property text-wrap doesn't exist : suppress suppress

.fieldLabelRed
{
    padding:0px 2px 0px 2px;
    margin:0px 10px 0px 0px;
    color:#FF0000;
    text-wrap:suppress; <--- This line
}

I have looked at the CSS manual, and this is what I've found, but I don't see anything wrong: Text Wrap Settings: the 'text-wrap' property

I have validated using CSS 2.1 as well as 3.0 and both give the same error.


Source: (StackOverflow)

Property border-radius doesn't exist in CSS level 2.1 but exists in : 6px 6px

I am new to web design and I have some problems in my website. First, it is not a cross-browser compatible website. I want to make it so, but I don't know how to do this. I have read some articles about this, but they have not been any help. Please tell me how I can design a cross-browser website.

Second, I have validated my website's CSS file and gotten these errors:

218 .box Property border-radius doesn't exist in CSS level 2.1 but exists in : 6px 6px 219 .box Property -moz-border-radius doesn't exist : 6px 6px 220 .box Property -webkit-border-radius doesn't exist : 6px 6px.

But I don't know how to solve this either.

http://www.harvestcreativemedia.com


Source: (StackOverflow)

Valid CSS with new properties

I am using a few CSS tricks to boost up the usability/appearance of my site in Webkit browsers. The two main ones are text-shadow and resize:none (on textareas - to stop that annoying page-breaking resize option in Safari and others).

The problem is that when I run my page through the W3 validator I get tons of:

Property text-shadow doesn't exist in CSS level 2.1 but exists in : #feb4b4 1px 1px 0 #feb4b4 1px 1px 0

-and-

Property resize doesn't exist in CSS level 2.1 but exists in : none none

Is this really not valid? Should I really not use this, or is it an error to just ignore?


Source: (StackOverflow)

ClassNotFoundException error when running css-validator.jar

I am trying to implement css-validator and it fails no matter what I do.

Here is the error I am getting:

"Directory Redacted"\framework-web>java -jar "Directory Redacted"\Downloads\
css-validator.jar http://www.w3.org
Exception in thread "main" java.lang.NoClassDefFoundError: org/w3c/tools/resourc
es/ProtocolException
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2531)
    at java.lang.Class.getMethod0(Class.java:2774)
    at java.lang.Class.getMethod(Class.java:1663)
    at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)
    at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)

Caused by: java.lang.ClassNotFoundException: org.w3c.tools.resources.ProtocolExc
eption
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    ... 6 more

Ideas?


Source: (StackOverflow)

A Few Questions About CSS3/@Import and Validation CSS2.1

This weekend, I made a template for a ficticious website. I do this every so often to try to build a very cleanly coded website template with minimal markup and very concise CSS.

I want my sites to validate perfectly before I hand them over to the client.

I have two problems ( I was wondering how others make a completely valid website ) using : http://validator.w3.org/check

I use some CSS3 properties (transitions, box-shadows, border-radius, etc) which make the site fail the validation since the validator checks against the CSS 2.1 spec (I guess). Are there any methods you guys use to still pass the validator with these properties in the CSS? Do you seperate them and wrap them in conditional comments?

The second is the @import CSS method. In my header, I have one stylesheet called main.css. In this stylesheet, I have something like this:

/*site structure*/
/*@import url("grid_system_960.css");*/

/*default style rules
@import url("layout.css"); */

/*navigation.css
@import url("navigation.css");*/

I simply do it like this to keep the CSS modular and clean, but the @import also failed the validator.

Has anybody got any suggestions that I could take to improve my structure/method?


Source: (StackOverflow)

Css file interaction in validation

I'm working with the w3c's css validator. The validator will take an html page & check all it's inline, embedded & linked CSS.

My question is - is it safe to validate all my css separately (validate the inline / embedded css without the linked css being available etc)?

To ask this another way - is there anything the validator can error check better when all the elements of the css for a page are validated together?


Source: (StackOverflow)

CSS (Keyframes): Sorry, the at-rule @-moz-keyframes is not implemented

While validating for CSS3, following error can be seen for my Website:

Sorry, the at-rule @-moz-keyframes is not implemented

Below is the CSS code:

Line 16:

@-moz-keyframes spin {
    0% {
        -moz-transform:rotate(0deg)
    }
    100% {
        -moz-transform:rotate(359deg)
    }
}
@-webkit-keyframes spin {
    0% {
        -webkit-transform:rotate(0deg)
    }
    100% {
        -webkit-transform:rotate(359deg)
    }
}
@-ms-keyframes spin {
    0% {
        -ms-transform:rotate(0deg)
    }
    100% {
        -ms-transform:rotate(359deg)
    }
}
@keyframes spin {
    0% {
        transform:rotate(0deg)
    }
    100% {
        transform:rotate(359deg)
    }
}
.fa-rotate-90 {
    filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);
    -webkit-transform:rotate(90deg);
    -moz-transform:rotate(90deg);
    -ms-transform:rotate(90deg);
    transform:rotate(90deg)
}

I would like to know what kind of CSS validation Error is this and what can be the better solution for this error


Source: (StackOverflow)

CSS2.1 validation fails for font-weight

In the CSS2.1 standard, I see that font-weight exists:

http://www.w3.org/TR/CSS21/fonts.html#font-boldness

But I get the following errors while validating:

50   h2  Value Error : font-weight 600 is not a font-weight value : 600
53   h5  Value Error : font-weight 900 is not a font-weight value : 900
95   div#logo    Value Error : font-weight 600 is not a font-weight value : 600
470  .contactInfoLink a  Value Error : font-weight 800 is not a font-weight value : 800

Why?


Source: (StackOverflow)