W3C Validator Error for type attribute
-
https://validator.w3.org/ throws these warnings:
The type attribute for the style element is not needed and should be omitted.
The type attribute is unnecessary for JavaScript resources.<script type=”text/javascript” src=”/wp-content/plugins/smart-slider-3/Public/SmartSlider3/Application/Frontend/Assets/dist/n2.min.js?ver=a96b01e9″>
<style type=”text/css”>.n2-ss-spinner-simple-white-container {
position: absolute;
top: 50%;
left: 50%;
margin: -20px;
background: #fff;
width: 20px;
height: 20px;
padding: 10px;
border-radius: 50%;
z-index: 1000;
}Any idea how to fix it? I have added some functionality to remove the type from script and style and it is working fine except it is not working for your plugin.
// remove type attribute enqueue
add_filter(‘style_loader_tag’, ‘puddinq_remove_type_attr’, 10, 2);
add_filter(‘script_loader_tag’, ‘puddinq_remove_type_attr’, 10, 2);function puddinq_remove_type_attr($tag, $handle) {
return preg_replace( “/type=[‘\”]text\/(javascript|css)[‘\”]/”, ”, $tag );
}NOTE:
In the global settings> I have selected Inline at HEAD for both CSS and JS.
- The topic ‘W3C Validator Error for type attribute’ is closed to new replies.