Creating Webrichtlijnen-compliant CSS using jQuery

(Not Related to a Specific Release) - (Not Related to a Specific Release)

Webrichtlijnen allow CSS version 2.1. Styles from higher versions are falgged as errors by the validator. You can still use these style directives in your Webrichtlijnen compliant site by adding them to the page using jQuery. Add the following snippet to a JavaScript item with Add To Global Include set to true:

  CopyCode image Copy Code
(function($){
    $(document).ready(function(){
        $("<style type='text/css'>div.rounded {border-radius: 10px 10px;}</style>").appendTo("head");
        $("<style type='text/css'>span.rounded {border-radius: 5px 5px;}</style>").appendTo("head");
    });
})(jQuery);

You can create a single monolithic style block, but for readability it's probably better to split the CSS over multiple style elements on separate lines.