Skip to content

Instantly share code, notes, and snippets.

@jaxxreal
Created June 4, 2014 06:42
Show Gist options
  • Save jaxxreal/85fb93ff8fae4756e842 to your computer and use it in GitHub Desktop.
Save jaxxreal/85fb93ff8fae4756e842 to your computer and use it in GitHub Desktop.
function addCSSRule(sheet, selector, rules, index) {
if(sheet.insertRule) {
sheet.insertRule(selector + "{" + rules + "}", index);
}
else {
sheet.addRule(selector, rules, index);
}
}
addCSSRule(document.styleSheets[0], "header", "float: left");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment