I create widgets for sites which I don t own.
在“html”之后,我做了以下工作:
var style = document.createElement( style ),
stylesString = minified css with a prefix for each selector eg. .my-prefix p {... } ,
rules = document.createTextNode(stylesString);
style.type = text/css ;
if(style.styleSheet) {
style.styleSheet.cssText = rules.nodeValue;
} else {
style.appendChild(rules);
}
document.getElementsByTagName( head )[0].appendChild(style);
But on some sites my styles are overridden.
是否有办法更精确地运用风格?
我不想(can)使用:
- iFrame
- !important on every property