Ever had it where your stylesheet contains code that doesn’t validate with the W3C standards…. Yet there’s not an easy way round it? For example ‘opacity’…..
This code adds an additional stylesheet after the page has loaded, allowing you to pop the in-valid code whilst achieving a valid mark from W3C…In this example the stylesheet is called 'invalid_styles.css' and it's in the 'css' folder.
if (document && document.getElementsByTagName) { var head = document.getElementsByTagName('head')[0]; var link = document.createElement('link'); link.type = 'text/css'; link.rel = 'stylesheet'; link.href = 'css/invalid_styles.css'; head.appendChild(link); }
Main Category