I use the webkit/mozilla border radius and box shadow CSS properties, but I want the CSS to validate (which it currently does not). Is there a way to get it to validate?
相关问题
- Adding a timeout to a render function in ReactJS
-
Why does the box-shadow property not apply to a
- Add animation to jQuery function Interval
- jQuery hover to slide?
- Issue with star rating css
It partly possible. Collect all your unsupported css classes in one file (css3.css)
Example:
css3.css
default.css
page.html
Search engine don't run client scripts, so your W3C unsupported attributes will not damage your SEO. As for green css validation, sorry, not yet.
@BoltClock is TOTALLY right on this one... W3C has indeed added a
vextwarning
levelBOOL
search criteria. It is NOT documented... but if you are using their SOAP API validation you can add a parameter to the payload of your validationGET
request....&vextwarning=true
for example... if you wanted to edit the CSS validator command in TextMate... you would "Edit Bundles...", aka
⌃
+
⌥+
⌘
+
Bto - something - more along the likes of
Notice that I also added a
level=css3
and changed thewarninglevel
. Alter these, according to the API, as needed.If you want to see all the parameters that are available via the "online" submit mechanism.... open up Firebug, or the Webkit inspector, etc.. while submitting a query via their form and check out the
full request content
to get even more options, as needed...No, they are browser specific properties, and not defined in the standard CSS specification.
That being said, they correctly follow the rules for vendor specific extension of CSS. It's just not in the W3C official CSS specification.
If you use a separate CSS file for my "invalid" or "browser-specific" CSS then use a little PHP to filter out that CSS from the validator:
Then link to the validator with CSS3 as the profile (accepts border-radius, text-shadow, etc.):
http://jigsaw.w3.org/css-validator/check/referer?profile=css3
$_SERVER['HTTP_HOST'] doesn't work but perhaps there is something that will?
12-12-2011
Kami really posted the best solution. I create a separate css3.js file and document.write(''); the CSS line by line:
CSS3.js
No, as they are not part of the standard the validator validates against. The only solution that comes to mind is to put the incompatible properties into a separate style sheet.
The Mozilla and WebKit specific properties will not validate. What you can do is separate your "enriched" css into a separate style sheet. Just like you separate your ie hack styles out of your main style sheet. This way your base style sheets will validate.