w3c-validation

Can I use non existing CSS classes?

白昼怎懂夜的黑 提交于 2019-11-26 08:59:21
问题 I have a table where I show/hide a full column by jQuery via a CSS class that doesn\'t exist: <table> <thead> <tr> <th></th> <th class=\"target\"></th> <th></th> </tr> </thead> <tbody> <tr> <td></td> <td class=\"target\"></td> <td></td> </tr> <tr> <td></td> <td class=\"target\"></td> <td></td> </tr> </tbody> </table> With this DOM I can do this in one line via jQuery: $(\'.target\').css(\'display\',\'none\'); This works perfectly, but is it valid to use CSS classes that aren\'t defined?

How to validate vendor prefixes in CSS like -webkit- and -moz-?

别等时光非礼了梦想. 提交于 2019-11-26 03:44:48
问题 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? http://jigsaw.w3.org/css-validator/ 回答1: 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. 回答2: Although the syntax for vendor extensions is

Are (non-void) self-closing tags valid in HTML5?

我的未来我决定 提交于 2019-11-25 22:13:32
问题 The W3C validator doesn\'t like self-closing tags (those that end with \" /> \") on non-void elements. (Void elements are those that may not ever contain any content.) Are they still valid in HTML5? Some examples of accepted void elements: <br /> <img src=\"\" /> <input type=\"text\" name=\"username\" /> Some examples of rejected non-void elements: <div id=\"myDiv\" /> <span id=\"mySpan\" /> <textarea id=\"someTextMessage\" /> Note: the W3C validator actually accepts void self-closing tags: